Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #7506 > unrolled thread
| Started by | vinay kumar <vinay5b9@gmail.com> |
|---|---|
| First post | 2011-07-03 09:32 -0700 |
| Last post | 2011-07-05 03:36 +0000 |
| Articles | 20 on this page of 34 — 14 participants |
Back to article view | Back to comp.lang.c
what is the output vinay kumar <vinay5b9@gmail.com> - 2011-07-03 09:32 -0700
Re: what is the output "Joachim Schmitz" <nospam.jojo@schmitz-digital.de> - 2011-07-03 19:43 +0200
Re: what is the output Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-03 13:47 -0400
Re: what is the output Keith Thompson <kst-u@mib.org> - 2011-07-03 12:15 -0700
Re: what is the output Chad <cdalten@gmail.com> - 2011-07-03 13:55 -0700
Re: what is the output "osmium" <r124c4u102@comcast.net> - 2011-07-03 16:20 -0500
Re: what is the output Keith Thompson <kst-u@mib.org> - 2011-07-03 14:24 -0700
Re: what is the output Chad <cdalten@gmail.com> - 2011-07-03 16:13 -0700
Re: what is the output "Morris Keesan" <mkeesan@post.harvard.edu> - 2011-07-03 21:10 -0400
Re: what is the output Keith Thompson <kst-u@mib.org> - 2011-07-04 14:22 -0700
Re: what is the output Todd Carnes <toddcarnes@gmail.com> - 2011-07-05 03:30 +0000
Re: what is the output John Gordon <gordon@panix.com> - 2011-07-05 02:26 +0000
Re: what is the output Tim Rentsch <txr@alumni.caltech.edu> - 2011-07-03 18:30 -0700
Re: what is the output Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-03 21:58 -0400
Re: what is the output Tim Rentsch <txr@alumni.caltech.edu> - 2011-07-04 17:10 -0700
Re: what is the output Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-04 21:42 -0400
Re: what is the output Shao Miller <sha0.miller@gmail.com> - 2011-07-04 22:51 -0400
Re: what is the output Tim Rentsch <txr@alumni.caltech.edu> - 2011-07-06 16:23 -0700
Re: what is the output Michael Press <rubrum@pacbell.net> - 2011-07-03 21:23 -0700
Re: what is the output Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-07-03 14:06 -0600
Re: what is the output Tim Rentsch <txr@alumni.caltech.edu> - 2011-07-03 18:19 -0700
Re: what is the output Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-03 22:12 -0400
Re: what is the output Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-07-03 21:16 -0600
Re: what is the output Keith Thompson <kst-u@mib.org> - 2011-07-04 13:59 -0700
Re: what is the output Tim Rentsch <txr@alumni.caltech.edu> - 2011-07-04 17:15 -0700
Re: what is the output Martin Ambuhl <mambuhl@earthlink.net> - 2011-07-04 17:21 -0400
Re: what is the output Tim Rentsch <txr@alumni.caltech.edu> - 2011-07-04 17:27 -0700
Re: what is the output Keith Thompson <kst-u@mib.org> - 2011-07-04 18:07 -0700
Re: what is the output Tim Rentsch <txr@alumni.caltech.edu> - 2011-07-06 17:08 -0700
Re: what is the output "Morris Keesan" <mkeesan@post.harvard.edu> - 2011-07-04 22:19 -0400
Re: what is the output Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-04 23:19 -0400
Re: what is the output Keith Thompson <kst-u@mib.org> - 2011-07-05 08:34 -0700
Re: what is the output Shao Miller <sha0.miller@gmail.com> - 2011-07-04 18:26 -0400
Re: what is the output Todd Carnes <toddcarnes@gmail.com> - 2011-07-05 03:36 +0000
Page 1 of 2 [1] 2 Next page →
| From | vinay kumar <vinay5b9@gmail.com> |
|---|---|
| Date | 2011-07-03 09:32 -0700 |
| Subject | what is the output |
| Message-ID | <fde0c807-8924-4328-887b-42495fcc80c5@d26g2000prn.googlegroups.com> |
main()
{
int d=010;
printf("%d",d);
}
please give with explanation
[toc] | [next] | [standalone]
| From | "Joachim Schmitz" <nospam.jojo@schmitz-digital.de> |
|---|---|
| Date | 2011-07-03 19:43 +0200 |
| Message-ID | <iuq9nu$12c$1@online.de> |
| In reply to | #7506 |
vinay kumar wrote:
> main()
> {
> int d=010;
> printf("%d",d);
> }
>
> please give with explanation
What output do you get.
What output did you expect and why?
[toc] | [prev] | [next] | [standalone]
| From | Eric Sosman <esosman@ieee-dot-org.invalid> |
|---|---|
| Date | 2011-07-03 13:47 -0400 |
| Message-ID | <iuqa1r$soe$1@dont-email.me> |
| In reply to | #7506 |
On 7/3/2011 12:32 PM, vinay kumar wrote:
> main()
> {
> int d=010;
> printf("%d",d);
> }
>
> please give with explanation
Undefined, because a variable-argument function is used
without a prototyped declaration.
Also implementation-defined, because the final line of text
output is not terminated with a newline.
Also either (1) "semi-undefined" because a C90 int-valued
function returns without returning a value, or (2) implementation-
defined because a C99 compiler must diagnose a function definition
without return type, and *if* it translates the program anyhow it
gives it an implementation-defined meaning.
... but the answer you're probably looking for is "8", and
the explanation will be found in the low-numbered pages of your
C textbook -- you know, that unopened volume you've been carrying
around. Open it (it won't bite you), and see what it has to say
about "integer constants" or some similar term.
--
Eric Sosman
esosman@ieee-dot-org.invalid
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Date | 2011-07-03 12:15 -0700 |
| Message-ID | <ln62nj5g6m.fsf@nuthaus.mib.org> |
| In reply to | #7513 |
Eric Sosman <esosman@ieee-dot-org.invalid> writes:
> On 7/3/2011 12:32 PM, vinay kumar wrote:
>> main()
>> {
>> int d=010;
>> printf("%d",d);
>> }
>>
>> please give with explanation
>
> Undefined, because a variable-argument function is used
> without a prototyped declaration.
>
> Also implementation-defined, because the final line of text
> output is not terminated with a newline.
>
> Also either (1) "semi-undefined" because a C90 int-valued
> function returns without returning a value, or (2) implementation-
> defined because a C99 compiler must diagnose a function definition
> without return type, and *if* it translates the program anyhow it
> gives it an implementation-defined meaning.
Actually, I think that the behavior of a program that violates a
constraint (given that the compiler chooses to translate it anyway)
is undefined, not implementation-defined.
[...]
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
[toc] | [prev] | [next] | [standalone]
| From | Chad <cdalten@gmail.com> |
|---|---|
| Date | 2011-07-03 13:55 -0700 |
| Message-ID | <bfa37ea9-d7cd-457b-8f28-070a945a8da6@p10g2000prf.googlegroups.com> |
| In reply to | #7513 |
On Jul 3, 10:47 am, Eric Sosman <esos...@ieee-dot-org.invalid> wrote:
> On 7/3/2011 12:32 PM, vinay kumar wrote:
>
> > main()
> > {
> > int d=010;
> > printf("%d",d);
> > }
>
> > please give with explanation
>
> Undefined, because a variable-argument function is used
> without a prototyped declaration.
>
> Also implementation-defined, because the final line of text
> output is not terminated with a newline.
>
> Also either (1) "semi-undefined" because a C90 int-valued
> function returns without returning a value, or (2) implementation-
> defined because a C99 compiler must diagnose a function definition
> without return type, and *if* it translates the program anyhow it
> gives it an implementation-defined meaning.
>
> ... but the answer you're probably looking for is "8", and
> the explanation will be found in the low-numbered pages of your
> C textbook -- you know, that unopened volume you've been carrying
> around. Open it (it won't bite you), and see what it has to say
> about "integer constants" or some similar term.
>
I know I shouldn't do this, but I'm going to take the bait on this
one. How do you figure the output is the "8".
Chad
[toc] | [prev] | [next] | [standalone]
| From | "osmium" <r124c4u102@comcast.net> |
|---|---|
| Date | 2011-07-03 16:20 -0500 |
| Message-ID | <97c4pnF11gU1@mid.individual.net> |
| In reply to | #7522 |
"Chad" wrote:
On Jul 3, 10:47 am, Eric Sosman <esos...@ieee-dot-org.invalid> wrote:
> On 7/3/2011 12:32 PM, vinay kumar wrote:
>
> > main()
> > {
> > int d=010;
> > printf("%d",d);
> > }
>
> > please give with explanation
>
> Undefined, because a variable-argument function is used
> without a prototyped declaration.
>
> Also implementation-defined, because the final line of text
> output is not terminated with a newline.
>
> Also either (1) "semi-undefined" because a C90 int-valued
> function returns without returning a value, or (2) implementation-
> defined because a C99 compiler must diagnose a function definition
> without return type, and *if* it translates the program anyhow it
> gives it an implementation-defined meaning.
>
> ... but the answer you're probably looking for is "8", and
> the explanation will be found in the low-numbered pages of your
> C textbook -- you know, that unopened volume you've been carrying
> around. Open it (it won't bite you), and see what it has to say
> about "integer constants" or some similar term.
>
I know I shouldn't do this, but I'm going to take the bait on this
one. How do you figure the output is the "8".
1x8^1 + 0x8^0 = 8
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Date | 2011-07-03 14:24 -0700 |
| Message-ID | <lnwrfz3vmc.fsf@nuthaus.mib.org> |
| In reply to | #7522 |
Chad <cdalten@gmail.com> writes:
> On Jul 3, 10:47 am, Eric Sosman <esos...@ieee-dot-org.invalid> wrote:
>> On 7/3/2011 12:32 PM, vinay kumar wrote:
>>
>> > main()
>> > {
>> > int d=010;
>> > printf("%d",d);
>> > }
>>
>> > please give with explanation
>>
>> Undefined, because a variable-argument function is used
>> without a prototyped declaration.
>>
>> Also implementation-defined, because the final line of text
>> output is not terminated with a newline.
>>
>> Also either (1) "semi-undefined" because a C90 int-valued
>> function returns without returning a value, or (2) implementation-
>> defined because a C99 compiler must diagnose a function definition
>> without return type, and *if* it translates the program anyhow it
>> gives it an implementation-defined meaning.
>>
>> ... but the answer you're probably looking for is "8", and
>> the explanation will be found in the low-numbered pages of your
>> C textbook -- you know, that unopened volume you've been carrying
>> around. Open it (it won't bite you), and see what it has to say
>> about "integer constants" or some similar term.
>
> I know I shouldn't do this, but I'm going to take the bait on this
> one. How do you figure the output is the "8".
Did you try running the program? What output did you get?
Eric already explained how to find the explanation: see what your C
textbook (or on-line tutorial, or copy of the standard) says about
integer constants.
If you're not interested in doing that, I can explain exactly
why the output is what it is, but you'd learn more by doing your
own research.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
[toc] | [prev] | [next] | [standalone]
| From | Chad <cdalten@gmail.com> |
|---|---|
| Date | 2011-07-03 16:13 -0700 |
| Message-ID | <6b2f8cbb-e8fc-45a2-b0dd-303418bc0234@r27g2000prr.googlegroups.com> |
| In reply to | #7527 |
On Jul 3, 2:24 pm, Keith Thompson <ks...@mib.org> wrote:
> Chad <cdal...@gmail.com> writes:
> > On Jul 3, 10:47 am, Eric Sosman <esos...@ieee-dot-org.invalid> wrote:
> >> On 7/3/2011 12:32 PM, vinay kumar wrote:
>
> >> > main()
> >> > {
> >> > int d=010;
> >> > printf("%d",d);
> >> > }
>
> >> > please give with explanation
>
> >> Undefined, because a variable-argument function is used
> >> without a prototyped declaration.
>
> >> Also implementation-defined, because the final line of text
> >> output is not terminated with a newline.
>
> >> Also either (1) "semi-undefined" because a C90 int-valued
> >> function returns without returning a value, or (2) implementation-
> >> defined because a C99 compiler must diagnose a function definition
> >> without return type, and *if* it translates the program anyhow it
> >> gives it an implementation-defined meaning.
>
> >> ... but the answer you're probably looking for is "8", and
> >> the explanation will be found in the low-numbered pages of your
> >> C textbook -- you know, that unopened volume you've been carrying
> >> around. Open it (it won't bite you), and see what it has to say
> >> about "integer constants" or some similar term.
>
> > I know I shouldn't do this, but I'm going to take the bait on this
> > one. How do you figure the output is the "8".
>
> Did you try running the program? What output did you get?
>
> Eric already explained how to find the explanation: see what your C
> textbook (or on-line tutorial, or copy of the standard) says about
> integer constants.
>
I got the number "8" after I compiled and ran this code on my Linux
box here at home. I just wasn't clear on why the computer produced the
number "8" and not the number "10".
Chad
[toc] | [prev] | [next] | [standalone]
| From | "Morris Keesan" <mkeesan@post.harvard.edu> |
|---|---|
| Date | 2011-07-03 21:10 -0400 |
| Message-ID | <op.vx2ljilm5qv6o3@toshiba-laptop> |
| In reply to | #7537 |
On Sun, 03 Jul 2011 19:13:06 -0400, Chad <cdalten@gmail.com> wrote:
> On Jul 3, 2:24 pm, Keith Thompson <ks...@mib.org> wrote:
>> Chad <cdal...@gmail.com> writes:
>> > On Jul 3, 10:47 am, Eric Sosman <esos...@ieee-dot-org.invalid> wrote:
>> >> On 7/3/2011 12:32 PM, vinay kumar wrote:
>>
>> >> > main()
>> >> > {
>> >> > int d=010;
>> >> > printf("%d",d);
>> >> > }
...
> I got the number "8" after I compiled and ran this code on my Linux
> box here at home. I just wasn't clear on why the computer produced the
> number "8" and not the number "10".
010 != 10
As someone else suggested, go read what any C reference has to say
about integer constants. Or just google for "C integer constant", and
see what the first result tells you.
--
Morris Keesan -- mkeesan@post.harvard.edu
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Date | 2011-07-04 14:22 -0700 |
| Message-ID | <ln7h7x4u81.fsf@nuthaus.mib.org> |
| In reply to | #7537 |
Chad <cdalten@gmail.com> writes:
> On Jul 3, 2:24 pm, Keith Thompson <ks...@mib.org> wrote:
>> Chad <cdal...@gmail.com> writes:
>> > On Jul 3, 10:47 am, Eric Sosman <esos...@ieee-dot-org.invalid> wrote:
>> >> On 7/3/2011 12:32 PM, vinay kumar wrote:
>>
>> >> > main()
>> >> > {
>> >> > int d=010;
>> >> > printf("%d",d);
>> >> > }
>>
>> >> > please give with explanation
>>
>> >> Undefined, because a variable-argument function is used
>> >> without a prototyped declaration.
>>
>> >> Also implementation-defined, because the final line of text
>> >> output is not terminated with a newline.
>>
>> >> Also either (1) "semi-undefined" because a C90 int-valued
>> >> function returns without returning a value, or (2) implementation-
>> >> defined because a C99 compiler must diagnose a function definition
>> >> without return type, and *if* it translates the program anyhow it
>> >> gives it an implementation-defined meaning.
>>
>> >> ... but the answer you're probably looking for is "8", and
>> >> the explanation will be found in the low-numbered pages of your
>> >> C textbook -- you know, that unopened volume you've been carrying
>> >> around. Open it (it won't bite you), and see what it has to say
>> >> about "integer constants" or some similar term.
>>
>> > I know I shouldn't do this, but I'm going to take the bait on this
>> > one. How do you figure the output is the "8".
>>
>> Did you try running the program? What output did you get?
>>
>> Eric already explained how to find the explanation: see what your C
>> textbook (or on-line tutorial, or copy of the standard) says about
>> integer constants.
>
> I got the number "8" after I compiled and ran this code on my Linux
> box here at home. I just wasn't clear on why the computer produced the
> number "8" and not the number "10".
That's probably because you ignored the advice several people have
given, to consult your C reference and see what it has to say about
integer constants.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
[toc] | [prev] | [next] | [standalone]
| From | Todd Carnes <toddcarnes@gmail.com> |
|---|---|
| Date | 2011-07-05 03:30 +0000 |
| Message-ID | <pan.2011.07.05.03.30.58@gmail.com> |
| In reply to | #7537 |
On Sun, 03 Jul 2011 16:13:06 -0700, Chad wrote:
> On Jul 3, 2:24 pm, Keith Thompson <ks...@mib.org> wrote:
>> Chad <cdal...@gmail.com> writes:
>> > On Jul 3, 10:47 am, Eric Sosman <esos...@ieee-dot-org.invalid> wrote:
>> >> On 7/3/2011 12:32 PM, vinay kumar wrote:
>>
>> >> > main()
>> >> > {
>> >> > int d=010;
>> >> > printf("%d",d);
>> >> > }
>>
>> >> > please give with explanation
>>
[snip]
> I got the number "8" after I compiled and ran this code on my Linux box
> here at home. I just wasn't clear on why the computer produced the
> number "8" and not the number "10".
>
> Chad
Someone already told you that a leading zero is used to indicate that you
are using the octal numbering system vice, the decimal system, correct?
What does the octal number 010 equal in the decimal system?
Hint: 010 in the binary system is equal to 2 in the decimal system.
Todd
[toc] | [prev] | [next] | [standalone]
| From | John Gordon <gordon@panix.com> |
|---|---|
| Date | 2011-07-05 02:26 +0000 |
| Message-ID | <iutsp0$5ku$1@reader1.panix.com> |
| In reply to | #7522 |
In <bfa37ea9-d7cd-457b-8f28-070a945a8da6@p10g2000prf.googlegroups.com> Chad <cdalten@gmail.com> writes:
> > > int d=010;
> I know I shouldn't do this, but I'm going to take the bait on this
> one. How do you figure the output is the "8".
Because a leading zero indicates octal notation instead of decimal.
--
John Gordon A is for Amy, who fell down the stairs
gordon@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
[toc] | [prev] | [next] | [standalone]
| From | Tim Rentsch <txr@alumni.caltech.edu> |
|---|---|
| Date | 2011-07-03 18:30 -0700 |
| Message-ID | <kfn4o324ytf.fsf@x-alumni2.alumni.caltech.edu> |
| In reply to | #7513 |
Eric Sosman <esosman@ieee-dot-org.invalid> writes:
> On 7/3/2011 12:32 PM, vinay kumar wrote:
>> main()
>> {
>> int d=010;
>> printf("%d",d);
>> }
>>
>> please give with explanation
>[snip]
>
> Also either (1) "semi-undefined" because a C90 int-valued
> function returns without returning a value, [snip]
Actually this aspect's behavior is defined; only the termination
status returned to the host environment is undefined. (Or it is
implementation-defined in a freestanding implementation.)
[toc] | [prev] | [next] | [standalone]
| From | Eric Sosman <esosman@ieee-dot-org.invalid> |
|---|---|
| Date | 2011-07-03 21:58 -0400 |
| Message-ID | <iur6ot$83h$1@dont-email.me> |
| In reply to | #7549 |
On 7/3/2011 9:30 PM, Tim Rentsch wrote:
> Eric Sosman<esosman@ieee-dot-org.invalid> writes:
>
>> On 7/3/2011 12:32 PM, vinay kumar wrote:
>>> main()
>>> {
>>> int d=010;
>>> printf("%d",d);
>>> }
>>>
>>> please give with explanation
>> [snip]
>>
>> Also either (1) "semi-undefined" because a C90 int-valued
>> function returns without returning a value, [snip]
>
> Actually this aspect's behavior is defined; only the termination
> status returned to the host environment is undefined. (Or it is
> implementation-defined in a freestanding implementation.)
To the first point, that's what I intended to indicate with the
weasel-words "semi-defined." The behavior is undefined if (1) the
caller of main() is written in C, and (2) the caller makes use of the
returned value. If the returned value is not used, there's no problem.
And if the caller is not written in C, then C's rules don't apply.
To the second point, in a free-standing implementation it is not
possible to predict (from the information given) what output, if any,
is produced. For all we know, printf() computes checksums of its
arguments, combines them into a complex number, and returns the
logarithm thereof after launching the nuclear missiles.
--
Eric Sosman
esosman@ieee-dot-org.invalid
[toc] | [prev] | [next] | [standalone]
| From | Tim Rentsch <txr@alumni.caltech.edu> |
|---|---|
| Date | 2011-07-04 17:10 -0700 |
| Message-ID | <kfnbox937v5.fsf@x-alumni2.alumni.caltech.edu> |
| In reply to | #7552 |
Eric Sosman <esosman@ieee-dot-org.invalid> writes:
> On 7/3/2011 9:30 PM, Tim Rentsch wrote:
>> Eric Sosman<esosman@ieee-dot-org.invalid> writes:
>>
>>> On 7/3/2011 12:32 PM, vinay kumar wrote:
>>>> main()
>>>> {
>>>> int d=010;
>>>> printf("%d",d);
>>>> }
>>>>
>>>> please give with explanation
>>> [snip]
>>>
>>> Also either (1) "semi-undefined" because a C90 int-valued
>>> function returns without returning a value, [snip]
>>
>> Actually this aspect's behavior is defined; only the termination
>> status returned to the host environment is undefined. (Or it is
>> implementation-defined in a freestanding implementation.)
>
> To the first point, that's what I intended to indicate with the
> weasel-words "semi-defined." The behavior is undefined if (1) the
> caller of main() is written in C, and (2) the caller makes use of the
> returned value. If the returned value is not used, there's no problem.
> And if the caller is not written in C, then C's rules don't apply.
Reading this reminds me of a quote: "I concede your point -
if things were different, they wouldn't be the same."
Yes, _if_ it were true that what we're looking at is only
part of a program rather than the whole program then these
considerations might come into play. For all we know this
piece comes after an #if 0 ...
However, most who commented on it, including yourself,
responded as though what's presented is an entire program.
In that context, C90 specifically and explicitly defines the
behavior of returning from main() without giving a return
value to say the termination status returned to the host
environment is undefined. Anything beyond that is simply
outside the scope of the C standard, as is true for all
terminations. You might as well say that 'return 0;' from
main() is "semi-defined"; in neither case is there anything
more to say about what happens further, as whatever that may
be is outside the realm of both language and implementation.
> To the second point, in a free-standing implementation it is not
> possible to predict (from the information given) what output, if any,
> is produced. For all we know, printf() computes checksums of its
> arguments, combines them into a complex number, and returns the
> logarithm thereof after launching the nuclear missiles.
Sorry, I thought it was clear from how the snipping was done
that I was addressing only the one aspect of the program
that the sentence being responded to concerns itself with,
namely, the behavor of returning without using a 'return'
statement.
[toc] | [prev] | [next] | [standalone]
| From | Eric Sosman <esosman@ieee-dot-org.invalid> |
|---|---|
| Date | 2011-07-04 21:42 -0400 |
| Message-ID | <iutq6b$l3n$1@dont-email.me> |
| In reply to | #7619 |
On 7/4/2011 8:10 PM, Tim Rentsch wrote:
> [...]
> Reading this reminds me of a quote: "I concede your point -
> if things were different, they wouldn't be the same."
Ass.
--
Eric Sosman
esosman@ieee-dot-org.invalid
[toc] | [prev] | [next] | [standalone]
| From | Shao Miller <sha0.miller@gmail.com> |
|---|---|
| Date | 2011-07-04 22:51 -0400 |
| Message-ID | <almarsoft.9058646713994681178@news.eternal-september.org> |
| In reply to | #7625 |
On Mon, 04 Jul 2011 21:42:34 -0400, Eric Sosman <esosman@ieee-dot-org.invalid> wrote: > On 7/4/2011 8:10 PM, Tim Rentsch wrote: > > [...] > > Reading this reminds me of a quote: "I concede your point - > > if things were different, they wouldn't be the same." > Ass. Some day I'd like to throw a comp.lang.c party. Even the 10-errors-in-5-lines-of-code-no-follow-up-post entities could find themselves as welcome guests. Then we could all share merry laughter and memories. See you all there!
[toc] | [prev] | [next] | [standalone]
| From | Tim Rentsch <txr@alumni.caltech.edu> |
|---|---|
| Date | 2011-07-06 16:23 -0700 |
| Message-ID | <kfnhb6z0z9l.fsf@x-alumni2.alumni.caltech.edu> |
| In reply to | #7625 |
Eric Sosman <esosman@ieee-dot-org.invalid> writes: > On 7/4/2011 8:10 PM, Tim Rentsch wrote: >> [...] >> Reading this reminds me of a quote: "I concede your point - >> if things were different, they wouldn't be the same." > > Ass. You gave a bogus argument, made in an effort to support a position that is clearly technically wrong. If you want to make bogus arguments, that's up to you, but if you do you shouldn't be surprised or outraged to get a response calling attention to that fact.
[toc] | [prev] | [next] | [standalone]
| From | Michael Press <rubrum@pacbell.net> |
|---|---|
| Date | 2011-07-03 21:23 -0700 |
| Message-ID | <rubrum-F0FBB0.21230603072011@news.albasani.net> |
| In reply to | #7513 |
In article <iuqa1r$soe$1@dont-email.me>,
Eric Sosman <esosman@ieee-dot-org.invalid> wrote:
> On 7/3/2011 12:32 PM, vinay kumar wrote:
> > main()
> > {
> > int d=010;
> > printf("%d",d);
> > }
> >
> > please give with explanation
>
> Undefined, because a variable-argument function is used
> without a prototyped declaration.
>
> Also implementation-defined, because the final line of text
> output is not terminated with a newline.
>
> Also either (1) "semi-undefined" because a C90 int-valued
> function returns without returning a value, or (2) implementation-
> defined because a C99 compiler must diagnose a function definition
> without return type, and *if* it translates the program anyhow it
> gives it an implementation-defined meaning.
>
> ... but the answer you're probably looking for is "8", and
> the explanation will be found in the low-numbered pages of your
> C textbook -- you know, that unopened volume you've been carrying
> around. Open it (it won't bite you), and see what it has to say
> about "integer constants" or some similar term.
I've had some nasty paper cuts from text books.
--
Michael Press
[toc] | [prev] | [next] | [standalone]
| From | Joe Pfeiffer <pfeiffer@cs.nmsu.edu> |
|---|---|
| Date | 2011-07-03 14:06 -0600 |
| Message-ID | <1b8vsfi0xx.fsf@snowball.wb.pfeifferfamily.net> |
| In reply to | #7506 |
vinay kumar <vinay5b9@gmail.com> writes:
> main()
> {
> int d=010;
> printf("%d",d);
> }
>
> please give with explanation
Please give with question?
[toc] | [prev] | [next] | [standalone]
Page 1 of 2 [1] 2 Next page →
Back to top | Article view | comp.lang.c
csiph-web