By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,129 Members | 2,300 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,129 IT Pros & Developers. It's quick & easy.

How do i set zero as a Integer?

P: n/a
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
Share this Question
Share on Google+
33 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a


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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a

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

P: n/a
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

P: n/a
tmp123 a écrit :
Or try scanf with "%d" instead of "%i".


Use scanf() and die..

--
A+

Emmanuel Delahaye
Feb 10 '06 #13

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
> 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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.