473,242 Members | 3,988 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,242 software developers and data experts.

How do i set zero as a Integer?

I mean, anything that follows a 0 is automatically turned into a octal
number. I want to have a integer variable that will hold numbers as
integers even if they begin with a zero.

for example:

int 08453

should print 08453 if i tried to use printf() on it, and not some octal
number.

Thanks.
Feb 10 '06 #1
33 2309
gk245 a écrit :
I mean, anything that follows a 0 is automatically turned into a octal
number.
Badly phrased.

<<anything that follows a 0 is automatically interpreted like the
textual representation of an octal number.>>
I want to have a integer variable that will hold numbers as
integers even if they begin with a zero.

for example:

int 08453
This is not C. What do you meant ?

int x = 08453;

? 'Invalid octal representation'

int x = 8453;

Is a valid decimal representation.
should print 08453 if i tried to use printf() on it, and not some octal
number.


How is it important to you to have this leading 0 in a source code ?

--
A+

Emmanuel Delahaye
Feb 10 '06 #2
gk245 wrote:
I mean, anything that follows a 0 is automatically turned into a octal
number. I want to have a integer variable that will hold numbers as
integers even if they begin with a zero.
I'm not sure I understand what you think is the problem, as integer
variables /always/ store values as integers, but let's try this:
for example:

int 08453
This has no meaning in C. Did you mean:

int i = 08453;
should print 08453 if i tried to use printf() on it, and not some
octal number.


In which case you should have written either of these:

int i = 8453;
int i = 020405;
int i = 0x2105;

An integer variable holds an integer /value/. This is different from
integer /constants/ (literals) which can be represented in different
bases. All the following are equivalent:

int i = 07;
int i = 0x7;
int i = 7;

They all assign value 7 (seven, as in "seven apples") to `i`. This
means, when you print `i` using printf(), you get its /value/ out in
whatever format you specify:

printf("%d\n",i); /* decimal */
printf("%x\n",i); /* hex; it's /not/ preceeded by 0x, though */
...

So, you can have it any way you want it, really.

--
BR, Vladimir

Every improvement in communication makes the bore more terrible.
-- Frank Moore Colby

Feb 10 '06 #3
Vladimir S. Oka wrote:
gk245 wrote:
I mean, anything that follows a 0 is automatically turned into a
octal
number. I want to have a integer variable that will hold numbers as
integers even if they begin with a zero.
I'm not sure I understand what you think is the problem, as integer
variables /always/ store values as integers, but let's try this:
for example:

int 08453


This has no meaning in C. Did you mean:

int i = 08453;


D'oh! You caught me out here! The above is not a valid octal number.
Octal digits are [0..7] only. Everything else still holds, though...
In which case you should have written either of these:

int i = 8453;
int i = 020405;
int i = 0x2105;

An integer variable holds an integer /value/. This is different from
integer /constants/ (literals) which can be represented in different
bases. All the following are equivalent:

int i = 07;
int i = 0x7;
int i = 7;

They all assign value 7 (seven, as in "seven apples") to `i`. This
means, when you print `i` using printf(), you get its /value/ out in
whatever format you specify:

printf("%d\n",i); /* decimal */
printf("%x\n",i); /* hex; it's /not/ preceeded by 0x, though */
...

So, you can have it any way you want it, really.


--
BR, Vladimir

Another good night not to sleep in a eucalyptus tree.

Feb 10 '06 #4
On Fri, 10 Feb 2006 13:17:34 -0500, Emmanuel Delahaye
<em***@YOURBRAnoos.fr> wrote:
gk245 a écrit :
I mean, anything that follows a 0 is automatically turned into a octal
number.
Badly phrased.

<<anything that follows a 0 is automatically interpreted like the
textual representation of an octal number.>>
I want to have a integer variable that will hold numbers as integers
even if they begin with a zero.
for example:
int 08453


This is not C. What do you meant ?

int x = 08453;

? 'Invalid octal representation'

int x = 8453;

Is a valid decimal representation.
should print 08453 if i tried to use printf() on it, and not some octal
number.

How is it important to you to have this leading 0 in a source code ?


Sorry, i meant int x = 08453;

Well, say you want the user to enter a number that starts with 0, then
have that number displayed properly using printf(). Is that not something
a variable set to integer would do? Or should i be using char instead?
Ofcourse, you couldn't do any calculations with char in the future if you
wanted to, so i was thinking it was better to leave it as a integer.

Is there a way, then, to truncate the leading zero when a user enters a
zero?

for example, like this:

printf("Enter Integer: \n");
scanf("%i\n", &var1);

Now, what if the user entered a few zeros before entering a Integer? I
can't use if-else, since its not allowed yet for me to use.
Feb 10 '06 #5
gk245 a écrit :
Sorry, i meant int x = 08453;

Well, say you want the user to enter a number that starts with 0, then
have that number displayed properly using printf().


This is completely different. Use fgets() and strtol() or strtoul(). If
you choose the base (say 10), the leading zeros will not be interpreted
a an octal representation heading, and the conversion will succed.

--
A+

Emmanuel Delahaye
Feb 10 '06 #6


gk245 wrote On 02/10/06 13:04,:
I mean, anything that follows a 0 is automatically turned into a octal
number. I want to have a integer variable that will hold numbers as
integers even if they begin with a zero.

for example:

int 08453

should print 08453 if i tried to use printf() on it, and not some octal
number.


You're mixing up two different things.

First, an integer variable just holds integer values.
As it happens, C requires integer variables to use binary
representation, but that's very nearly irrelevant: if it
were not for a few operators like ^ and >>, whose behavior
is difficult to describe in base three, say, there would
be no need for C to have such a requirement. If you're
not using these "bit-defined" operations, you can (and,
I'd say, should) simply forget about the number base in
most instances. So: an integer variable holds integer
values, not decimal values or octal values.

Second, C programs use various source-code notations
that allow the programmer to specify values. There are
different notations for different types of value (for
example, "abc" is the notation for a string value, 1.5
is the notation for a double value). Some types have
more than one notation: 1.5 and 0.15e1 and 15e-1 are
different ways of writing one-and-a-half as a double
constant. For integers there are three ways[*] to denote
an integer constant: in decimal, octal, or hexadecimal
base. (Actually, there are a few other ways. Without
any intent to ridicule you, I suspect you may not be ready
to learn about them yet and I'd prefer not to add to your
confusion just now.)

The important thing to note is that the form of the
notation is part of the C language. When you start a
number with a zero digit, you have announced to the
compiler that you intend to use octal notation to express
the desired value. Start it with zero and X and you
declare that you're using hexadecimal. Start it with a
non-zero digit and you say you're using decimal. That's
it, the unalterable It: it's the convention of C source
code notations. The conventions are in a sense arbitrary
(some other languages, for example, use notations like
'X'C and 'O'14 -- I have even seen twelve written as
"(2)300", the double quotes being part of the notation).
However, once the conventions are chosen they cannot be
changed. They exist as a means of communicating your
intent to the compiler; if you say one thing but mean
another, the compiler will fail to understand you properly.

Finally, observe that these conventions apply only
in C source code (and to a few library functions). There
is no rule saying that the numbers you print must follow
the same conventions that C source does. For example,
try printf("%05d\n", 8453) and see if you like what you get.

--
Er*********@sun.com

Feb 10 '06 #7
On Fri, 10 Feb 2006 13:31:57 -0500, Vladimir S. Oka
<no****@btopenworld.com> wrote:
Vladimir S. Oka wrote:
gk245 wrote:
I mean, anything that follows a 0 is automatically turned into a
octal
number. I want to have a integer variable that will hold numbers as
integers even if they begin with a zero.


I'm not sure I understand what you think is the problem, as integer
variables /always/ store values as integers, but let's try this:
for example:

int 08453


This has no meaning in C. Did you mean:

int i = 08453;


D'oh! You caught me out here! The above is not a valid octal number.
Octal digits are [0..7] only. Everything else still holds, though...
In which case you should have written either of these:

int i = 8453;
int i = 020405;
int i = 0x2105;

An integer variable holds an integer /value/. This is different from
integer /constants/ (literals) which can be represented in different
bases. All the following are equivalent:

int i = 07;
int i = 0x7;
int i = 7;

They all assign value 7 (seven, as in "seven apples") to `i`. This
means, when you print `i` using printf(), you get its /value/ out in
whatever format you specify:

printf("%d\n",i); /* decimal */
printf("%x\n",i); /* hex; it's /not/ preceeded by 0x, though */
...

So, you can have it any way you want it, really.


I just found something out...you used %d, and i was using %i. For some
reason or other, %d displays the integer after truncating the leading
zeros. %i doesn't...if you feed it anything beginning with a 0, it turns
the output into. So, i had this:

printf("%i\n",i);

Changing it to:

printf("%d\n",i);

Works wonderfully. Thanks. Not sure why %i doesn't work.

Feb 10 '06 #8
gk245 wrote:
Sorry, i meant int x = 08453;
Why are you interested in octal numbers, and how do you plan to deal
with them, if you don't know they can't have `8` in them?
Well, say you want the user to enter a number that starts with 0, then
have that number displayed properly using printf(). Is that not
something a variable set to integer would do? Or should i be using
char instead? Ofcourse, you couldn't do any calculations with char in
the future if you wanted to, so i was thinking it was better to leave
it as a integer.
If you know what base your user will use, you can use appropriate format
in scanf(): %d for decimal, %o for octal, and %x for hex.
Is there a way, then, to truncate the leading zero when a user enters
a zero?
You cold get user input as a string (NB, do /not/ use scanf() for this,
as it can overrun space you allocate for the string -- rather, use
fgets()/sscanf(); for the same reason do /not/ use gets()). Once you
have that, you can parse that string to your heart's content.
for example, like this:

printf("Enter Integer: \n");
scanf("%i\n", &var1);
("%i" is rarely used these days)
Now, what if the user entered a few zeros before entering a Integer?
I can't use if-else, since its not allowed yet for me to use.


As you've written it, the number will still be interpreted as decimal.
It's the format (conversion) specifier in scanf() that matters.

--
BR, Vladimir

Another good night not to sleep in a eucalyptus tree.

Feb 10 '06 #9
gk245 wrote:
I just found something out...you used %d, and i was using %i. For
some reason or other, %d displays the integer after truncating the
leading
zeros. %i doesn't...if you feed it anything beginning with a 0, it
turns
the output into. So, i had this:

printf("%i\n",i);

Changing it to:

printf("%d\n",i);

Works wonderfully. Thanks. Not sure why %i doesn't work.


I don't understand: %i should be the same as %d for printf(). It /is/
different for scanf() (at least on my gcc/libc; couldn't find it in C99
-- any takers?), and it'll give you the behaviour you say don't like
(i.e. it'll interpret 0nnn as octal, and 0xnnn as hex). One lives and
learns...

--
BR, Vladimir

In seeking the unattainable, simplicity only gets in the way.
-- Epigrams in Programming, ACM SIGPLAN Sept. 1982

Feb 10 '06 #10

Emmanuel Delahaye wrote:
gk245 a écrit :
Sorry, i meant int x >
Well, say you want the user to enter a number that starts with 0, then
have that number displayed properly using printf().


This is completely different. Use fgets() and strtol() or strtoul(). If
you choose the base (say 10), the leading zeros will not be interpreted
a an octal representation heading, and the conversion will succed.

--
A+

Emmanuel Delahaye


Or try scanf with "%d" instead of "%i".

Feb 10 '06 #11
gk245 a écrit :
Not sure why %i doesn't work.


It works, but differently. actually scanf() with "%i", like strto[u]l()
with base 0, interprets the string like in a C-source (handy if you are
writing a c-compiler!).

if 0x
hexa
else if 0
octal
else
decimal
endif

Why don't you read a C-book ? It's well explained...

--
A+

Emmanuel Delahaye
Feb 10 '06 #12
tmp123 a écrit :
Or try scanf with "%d" instead of "%i".


Use scanf() and die..

--
A+

Emmanuel Delahaye
Feb 10 '06 #13
Yeah, i was using scanf("%i" &var1); to get the input from the user, then i
passed that to printf("%i", var1);. This causes the wrong behaviour if the
input from the user to scanf() begins with 0's. Not sure what printf() was
putting out with %i, but i had assumed it was octals. Guess %i might be
obsolete..or the compiler just doesn't like it (MinGW).

"Vladimir S. Oka" <no****@btopenworld.com> wrote in message
news:ds**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com...
gk245 wrote:
I just found something out...you used %d, and i was using %i. For
some reason or other, %d displays the integer after truncating the
leading
zeros. %i doesn't...if you feed it anything beginning with a 0, it
turns
the output into. So, i had this:

printf("%i\n",i);

Changing it to:

printf("%d\n",i);

Works wonderfully. Thanks. Not sure why %i doesn't work.


I don't understand: %i should be the same as %d for printf(). It /is/
different for scanf() (at least on my gcc/libc; couldn't find it in C99
-- any takers?), and it'll give you the behaviour you say don't like
(i.e. it'll interpret 0nnn as octal, and 0xnnn as hex). One lives and
learns...

--
BR, Vladimir

In seeking the unattainable, simplicity only gets in the way.
-- Epigrams in Programming, ACM SIGPLAN Sept. 1982

Feb 10 '06 #14
gk245 a écrit :
Not sure what printf() was
putting out with %i, but i had assumed it was octals. Guess %i might be
obsolete..or the compiler just doesn't like it (MinGW).


%i and %d with printf() and an int have exactly the same behaviour.

--
A+

Emmanuel Delahaye
Feb 10 '06 #15
Vladimir S. Oka wrote:
Vladimir S. Oka wrote:
gk245 wrote:
<snip>
for example:

int 08453

This has no meaning in C. Did you mean:

int i = 08453;


D'oh! You caught me out here! The above is not a valid octal number.
Octal digits are [0..7] only. Everything else still holds, though...


<snip>

Actually as a historical odity, if you use K&R C then 8 *is* a valid
octal digit.

To quote from Appenx C: Summary of Changes of K&R2 (top of page 260 in
my copy), "Everyone's favourite trivial change: 8 and 9 are not octal
digits."
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
Feb 10 '06 #16
gk245 wrote:
Yeah, i was using scanf("%i" &var1); to get the input from the user,
then i passed that to printf("%i", var1);. This causes the wrong
behaviour if the input from the user to scanf() begins with 0's. Not
sure what printf() was putting out with %i, but i had assumed it was
octals. Guess %i might be obsolete..or the compiler just doesn't like
it (MinGW).


Please don't top-post...

No, it's not wrong. It's just as it's supposed to be.

Using %d or %i with printf() should produce the same result, AFAIK (for
octal use %o, for hex %h). It's the scanf() that behaves differently
for the two (do heed all the warnings you got for not using scanf(),
though).

--
BR, Vladimir

To iterate is human, to recurse, divine.

Feb 10 '06 #17
gk245 wrote:
On Fri, 10 Feb 2006 13:17:34 -0500, Emmanuel Delahaye
<em***@YOURBRAnoos.fr> wrote:
gk245 a écrit :
I mean, anything that follows a 0 is automatically turned into a
octal number.


Badly phrased.

<<anything that follows a 0 is automatically interpreted like the
textual representation of an octal number.>>
I want to have a integer variable that will hold numbers as integers
even if they begin with a zero.
for example:
int 08453


This is not C. What do you meant ?

int x = 08453;

? 'Invalid octal representation'

int x = 8453;

Is a valid decimal representation.
should print 08453 if i tried to use printf() on it, and not some
octal number.

How is it important to you to have this leading 0 in a source code ?


Sorry, i meant int x = 08453;

Well, say you want the user to enter a number that starts with 0, then
have that number displayed properly using printf(). Is that not
something a variable set to integer would do? Or should i be using char
instead? Ofcourse, you couldn't do any calculations with char in the
future if you wanted to, so i was thinking it was better to leave it as
a integer.

Is there a way, then, to truncate the leading zero when a user enters a
zero?

for example, like this:

printf("Enter Integer: \n");
scanf("%i\n", &var1);

Now, what if the user entered a few zeros before entering a Integer? I
can't use if-else, since its not allowed yet for me to use.

%i reads an int * in base 0, meaning that (strtol) 0xABC reads a hexa
number and 0ABC reads an octal number and anything else reads a base
10 number. The leading 0 has no meaning for an integer number. If you
want to use int as a code for something that should allow 0 as the
leading digit then you can't do that. You should store the digits as char *.
--
Ioan - Ciprian Tandau
tandau _at_ freeshell _dot_ org (hope it's not too late)
(... and that it still works...)

Feb 10 '06 #18
Flash Gordon wrote:
Vladimir S. Oka wrote:
Vladimir S. Oka wrote:
gk245 wrote:
<snip>
for example:

int 08453
This has no meaning in C. Did you mean:

int i = 08453;


D'oh! You caught me out here! The above is not a valid octal number.
Octal digits are [0..7] only. Everything else still holds, though...


<snip>

Actually as a historical odity, if you use K&R C then 8 *is* a valid
octal digit.

To quote from Appenx C: Summary of Changes of K&R2 (top of page 260 in
my copy), "Everyone's favourite trivial change: 8 and 9 are not octal
digits."


That's interesting! Unfortunately, I don't have a copy of K&R1, and
(probably for that reason) have never bother reading Appendix C in
K&R2.

And what values did 8 and 9 yield according to K&R1?

--
BR, Vladimir

Any philosophy that can be put in a nutshell belongs there.
-- Sydney J. Harris

Feb 10 '06 #19
On Fri, 10 Feb 2006 13:42:16 -0500, Eric Sosman <Er*********@sun.com>
wrote:


gk245 wrote On 02/10/06 13:04,:
I mean, anything that follows a 0 is automatically turned into a octal
number. I want to have a integer variable that will hold numbers as
integers even if they begin with a zero.

for example:

int 08453

should print 08453 if i tried to use printf() on it, and not some octal
number.


You're mixing up two different things.

First, an integer variable just holds integer values.
As it happens, C requires integer variables to use binary
representation, but that's very nearly irrelevant: if it
were not for a few operators like ^ and >>, whose behavior
is difficult to describe in base three, say, there would
be no need for C to have such a requirement. If you're
not using these "bit-defined" operations, you can (and,
I'd say, should) simply forget about the number base in
most instances. So: an integer variable holds integer
values, not decimal values or octal values.

Second, C programs use various source-code notations
that allow the programmer to specify values. There are
different notations for different types of value (for
example, "abc" is the notation for a string value, 1.5
is the notation for a double value). Some types have
more than one notation: 1.5 and 0.15e1 and 15e-1 are
different ways of writing one-and-a-half as a double
constant. For integers there are three ways[*] to denote
an integer constant: in decimal, octal, or hexadecimal
base. (Actually, there are a few other ways. Without
any intent to ridicule you, I suspect you may not be ready
to learn about them yet and I'd prefer not to add to your
confusion just now.)

The important thing to note is that the form of the
notation is part of the C language. When you start a
number with a zero digit, you have announced to the
compiler that you intend to use octal notation to express
the desired value. Start it with zero and X and you
declare that you're using hexadecimal. Start it with a
non-zero digit and you say you're using decimal. That's
it, the unalterable It: it's the convention of C source
code notations. The conventions are in a sense arbitrary
(some other languages, for example, use notations like
'X'C and 'O'14 -- I have even seen twelve written as
"(2)300", the double quotes being part of the notation).
However, once the conventions are chosen they cannot be
changed. They exist as a means of communicating your
intent to the compiler; if you say one thing but mean
another, the compiler will fail to understand you properly.

Finally, observe that these conventions apply only
in C source code (and to a few library functions). There
is no rule saying that the numbers you print must follow
the same conventions that C source does. For example,
try printf("%05d\n", 8453) and see if you like what you get.

Wow, thx for the big explanation.
Feb 10 '06 #20
A little off-topic question: Should i be using 'Reply-All' or 'Reply' in
these groups? I know that i shouldn't top-post, so might as well know
which reply button to use.

Thx.
Feb 10 '06 #21
gk245 wrote:
A little off-topic question: Should i be using 'Reply-All' or 'Reply'
in
these groups? I know that i shouldn't top-post, so might as well know
which reply button to use.

Thx.


Discussing topicality and netiquette is not off-topic. It's a pleasure
seeing someone willing to follow both.

Use this as guidance:

"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>

BTW, if you could only capitalise your I's your posting would be almost
perfect. Also, avoid geek- or txt-speak (e.g. thx, u, r, ...) ;-)

--
BR, Vladimir

This life is a test. It is only a test. Had this been an actual life,
you would have received further instructions as to what to do and where
to go.

Feb 10 '06 #22
On Fri, 10 Feb 2006 15:56:50 -0500, Vladimir S. Oka
<no****@btopenworld.com> wrote:
gk245 wrote:
A little off-topic question: Should i be using 'Reply-All' or 'Reply'
in
these groups? I know that i shouldn't top-post, so might as well know
which reply button to use.

Thx.


Discussing topicality and netiquette is not off-topic. It's a pleasure
seeing someone willing to follow both.

Use this as guidance:

"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>

BTW, if you could only capitalise your I's your posting would be almost
perfect. Also, avoid geek- or txt-speak (e.g. thx, u, r, ...) ;-)


I see. I don't use google groups, but rather my ISP gives access to the
newsgroups. So, i just use a client like outlook express or opera's M2 to
post. They both have a "Reply All" or "Reply Group" button in addition to
a "Reply" button. That is where i am getting confused. Basically, i
don't want to bother or "spam" people with emails. I just want to post in
the newsgroup. Thats my main concern. So far, i have noticed that just
using "Reply" button makes a "mini-thread" under that person, while "Reply
All" just posts it as a separate post. Which one is a more preferred way
of posting?

Thx.
Feb 10 '06 #23
Vladimir S. Oka wrote:
Flash Gordon wrote:


<snip>
Actually as a historical odity, if you use K&R C then 8 *is* a valid
octal digit.

To quote from Appenx C: Summary of Changes of K&R2 (top of page 260 in
my copy), "Everyone's favourite trivial change: 8 and 9 are not octal
digits."


That's interesting! Unfortunately, I don't have a copy of K&R1, and
(probably for that reason) have never bother reading Appendix C in
K&R2.

And what values did 8 and 9 yield according to K&R1?


I don't know, I don't have a copy of K&R1.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
Feb 10 '06 #24
On 2006-02-10, gk245 <to*****@mail.com> wrote:
for example, like this:

printf("Enter Integer: \n");
scanf("%i\n", &var1);

Now, what if the user entered a few zeros before entering a Integer? I
can't use if-else, since its not allowed yet for me to use.


You could use %d instead of %i.
Feb 10 '06 #25
On Fri, 10 Feb 2006 21:56:14 -0000, gk245 <to*****@mail.com> wrote:
On Fri, 10 Feb 2006 15:56:50 -0500, Vladimir S. Oka
<no****@btopenworld.com> wrote:
gk245 wrote:
A little off-topic question: Should i be using 'Reply-All' or 'Reply'
in
these groups? I know that i shouldn't top-post, so might as well know
which reply button to use.

Thx.


Discussing topicality and netiquette is not off-topic. It's a pleasure
seeing someone willing to follow both.

Use this as guidance:

"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>

BTW, if you could only capitalise your I's your posting would be almost
perfect. Also, avoid geek- or txt-speak (e.g. thx, u, r, ...) ;-)


I see. I don't use google groups, but rather my ISP gives access to the
newsgroups. So, i just use a client like outlook express or opera's M2
to post. They both have a "Reply All" or "Reply Group" button in
addition to a "Reply" button. That is where i am getting confused.
Basically, i don't want to bother or "spam" people with emails. I just
want to post in the newsgroup. Thats my main concern. So far, i have
noticed that just using "Reply" button makes a "mini-thread" under that
person, while "Reply All" just posts it as a separate post. Which one
is a more preferred way of posting?


I just posted this from Opera 8.51 (Linux), using "Reply". I believe
that's the one you want. I don't know about OE, as I don't bow to The
Beast. ;-)

--
BR, Vladimir

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Feb 10 '06 #26
On 2006-02-10, Vladimir S. Oka <no****@btopenworld.com> wrote:
Flash Gordon wrote:
Vladimir S. Oka wrote:
Vladimir S. Oka wrote:

gk245 wrote:


<snip>
> for example:
>
> int 08453
This has no meaning in C. Did you mean:

int i = 08453;

D'oh! You caught me out here! The above is not a valid octal number.
Octal digits are [0..7] only. Everything else still holds, though...


<snip>

Actually as a historical odity, if you use K&R C then 8 *is* a valid
octal digit.

To quote from Appenx C: Summary of Changes of K&R2 (top of page 260 in
my copy), "Everyone's favourite trivial change: 8 and 9 are not octal
digits."


That's interesting! Unfortunately, I don't have a copy of K&R1, and
(probably for that reason) have never bother reading Appendix C in
K&R2.

And what values did 8 and 9 yield according to K&R1?


I would assume 8 [010] and 9 [011] times the appropriate power of eight
[010].
Feb 10 '06 #27
> On Fri, 10 Feb 2006 21:56:14 -0000, gk245 <to*****@mail.com> wrote:
On Fri, 10 Feb 2006 15:56:50 -0500, Vladimir S. Oka
<no****@btopenworld.com> wrote:
gk245 wrote:

A little off-topic question: Should i be using 'Reply-All' or 'Reply'
in
these groups? I know that i shouldn't top-post, so might as well know
which reply button to use.

Thx.

Discussing topicality and netiquette is not off-topic. It's a pleasure
seeing someone willing to follow both.

Use this as guidance:

"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>

BTW, if you could only capitalise your I's your posting would be almost
perfect. Also, avoid geek- or txt-speak (e.g. thx, u, r, ...) ;-)


I see. I don't use google groups, but rather my ISP gives access to the
newsgroups. So, i just use a client like outlook express or opera's M2 to
post. They both have a "Reply All" or "Reply Group" button in addition to
a "Reply" button. That is where i am getting confused. Basically, i don't
want to bother or "spam" people with emails. I just want to post in the
newsgroup. Thats my main concern. So far, i have noticed that just using
"Reply" button makes a "mini-thread" under that person, while "Reply All"
just posts it as a separate post. Which one is a more preferred way of
posting?


I just posted this from Opera 8.51 (Linux), using "Reply". I believe that's
the one you want. I don't know about OE, as I don't bow to The Beast. ;-)


I see, thx. :D
Feb 10 '06 #28
gk245 <to*****@mail.com> writes:
A little off-topic question: Should i be using 'Reply-All' or 'Reply'
in these groups? I know that i shouldn't top-post, so might as well
know which reply button to use.


That depends on what "Reply-All" and "Reply" mean, and that's
something that can be answered only by reading the documentation for
your newsreading software. (The software you're using probably has an
online help system.)

The distinction between "Reply-All" and "Reply" usually applies to
e-mail; "Reply" replies only to the sender, whereas "Reply-All"
replies to the sender and all the other recipients.

When you post a followup to a Usenet article, you almost certainly
*don't* want to send e-mail as well.

Ideally, a newsreader should clearly distinguish between a "reply"
(sent by e-mail) and a "followup" posted to the newsgroup). If yours
doesn't, you'll need to dig through the documentation to figure out
how to make it behave properly.

If you want to experiment, you can post test messages to alt.test.
(Please don't post test messages here.)

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Feb 10 '06 #29
Jordan Abel wrote:
On 2006-02-10, Vladimir S. Oka <no****@btopenworld.com> wrote:
Flash Gordon wrote:
To quote from Appenx C: Summary of Changes of K&R2 (top of page 260
in my copy), "Everyone's favourite trivial change: 8 and 9 are not
octal digits."


That's interesting! Unfortunately, I don't have a copy of K&R1, and
(probably for that reason) have never bother reading Appendix C in
K&R2.

And what values did 8 and 9 yield according to K&R1?


I would assume 8 [010] and 9 [011] times the appropriate power of
eight [010].


Yes, that seems logical. I couldn't think about any other either, but
still though I'd ask.

--
BR, Vladimir

If you are over 80 years old and accompanied
by your parents, we will cash your check.

Feb 10 '06 #30
On 2006-02-10, Vladimir S. Oka <no****@btopenworld.com> wrote:
Jordan Abel wrote:
On 2006-02-10, Vladimir S. Oka <no****@btopenworld.com> wrote:
Flash Gordon wrote:
To quote from Appenx C: Summary of Changes of K&R2 (top of page 260
in my copy), "Everyone's favourite trivial change: 8 and 9 are not
octal digits."

That's interesting! Unfortunately, I don't have a copy of K&R1, and
(probably for that reason) have never bother reading Appendix C in
K&R2.

And what values did 8 and 9 yield according to K&R1?


I would assume 8 [010] and 9 [011] times the appropriate power of
eight [010].


Yes, that seems logical. I couldn't think about any other either, but
still though I'd ask.


Could be 7 like in bc
Feb 10 '06 #31
gk245 wrote:

<snip>
I see. I don't use google groups, but rather my ISP gives access to the
newsgroups. So, i just use a client like outlook express or opera's M2
to post. They both have a "Reply All" or "Reply Group" button in
addition to a "Reply" button. That is where i am getting confused.
Basically, i don't want to bother or "spam" people with emails. I just
want to post in the newsgroup. Thats my main concern. So far, i have
noticed that just using "Reply" button makes a "mini-thread" under that
person, while "Reply All" just posts it as a separate post. Which one
is a more preferred way of posting?


We appreciate you caring enough to ask how to post correctly.

Generally you should just use the ordinary "Reply" button. This, on any
half way decent client, will normally send the reply to the correct
place. I.e. it will reply normally correctly to the group(s) and if
someone has set "follow ups" it will follow the redirection. Your post
showing under and attached to the post you replied to is normal and
correct behaviour. The posts are presented like that to make it easier
to follow the "thread" or "sub-thread", i.e. the sequence of posts.

The "Reply All" button may additionally attempt to email the original
poster, and it is extremely rare that this is the correct thing to do in
a news group.

I would guess that the "Reply Group" button replies to the group even if
follow ups where directed else where, but you should check the help
system for the program to see.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
Feb 10 '06 #32
on 2/10/2006, Keith Thompson supposed :
gk245 <to*****@mail.com> writes:
A little off-topic question: Should i be using 'Reply-All' or 'Reply'
in these groups? I know that i shouldn't top-post, so might as well
know which reply button to use.


That depends on what "Reply-All" and "Reply" mean, and that's
something that can be answered only by reading the documentation for
your newsreading software. (The software you're using probably has an
online help system.)

The distinction between "Reply-All" and "Reply" usually applies to
e-mail; "Reply" replies only to the sender, whereas "Reply-All"
replies to the sender and all the other recipients.

When you post a followup to a Usenet article, you almost certainly
*don't* want to send e-mail as well.

Ideally, a newsreader should clearly distinguish between a "reply"
(sent by e-mail) and a "followup" posted to the newsgroup). If yours
doesn't, you'll need to dig through the documentation to figure out
how to make it behave properly.

If you want to experiment, you can post test messages to alt.test.
(Please don't post test messages here.)


Cool, i didn't know there was a alt.test. Heeehee, going there now.
Thanks all for the help. :D
Feb 10 '06 #33
In article <gt************@news.flash-gordon.me.uk> Flash Gordon <sp**@flash-gordon.me.uk> writes:
Vladimir S. Oka wrote:

....
And what values did 8 and 9 yield according to K&R1?


I don't know, I don't have a copy of K&R1.


I would think just what mathematics prescribes ;-).
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
Feb 13 '06 #34

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Margaret MacDonald | last post by:
Probably it's something dumb that I'm doing/not doing, but echo doesn't seem to want to echo a literal zero when the value of some var is zero. E.g.: $foo = 0 ; echo 'foo is ' . $foo ; ...
15
by: I wish | last post by:
#include <string.h> int a; memset( a, 0, sizeof(a) ); Does that guarantee all bits zero? -- |
25
by: Mantorok Redgormor | last post by:
Finally, control is returned to the host environment. If the value of status is zero or EXIT_SUCCESS, an implementation-defined form of the status successful termination is returned. beyond this...
53
by: Zhiqiang Ye | last post by:
Hi, All I am reading FAQ of this group. I have a question about this: http://www.eskimo.com/~scs/C-faq/q7.31.html It says: " p = malloc(m * n); memset(p, 0, m * n); The zero fill is...
15
by: angellian | last post by:
Sorry to raise a stupid question but I tried many methods which did work. how can I conserve the initial zero when I try to convert STR(06) into string in SQL statment? It always gives me 6...
6
by: Marko | last post by:
Hello all, I hope someone can help me; if got a value in a cell (040 1234567), when I run a query in the Analyser I got as respons only 40 1234567, so missing the zero (0) not the whole number...
46
by: lovecreatesbea... | last post by:
Do you prefer malloc or calloc? p = malloc(size); Which of the following two is right to get same storage same as the above call? p = calloc(1, size); p = calloc(size, 1);
23
by: Hallvard B Furuseth | last post by:
As far as I can tell, (x & -1) is nonzero if the integer x is negative zero. So for signed types, x == 0 does not guarantee (x & foo) == 0. Is that right? (Not that I expect to ever encounter a...
11
by: Bernard.Mangay | last post by:
The remainder is non zero due to rounding errors. How can I remove the rounding errors?
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.