Z
Zach
I recall someone posting a website that had the complete K&R (2nd Ed.
- ANSI) answers posted but I cannot find the post.
Zach
- ANSI) answers posted but I cannot find the post.
Zach
I recall someone posting a website that had the complete K&R (2nd Ed.
- ANSI) answers posted but I cannot find the post.
Zach said:
Not complete (if I recall correctly) - but the Web site you're looking for
is:
<http://clc-wiki.net/wiki/K&R2_solutions>
stop said:news:3c8dd0c2-8f30-41ec-8b30-b3901442e7ee@n75g2000hsh.googlegroups.com...
There's a worthwhile hard-copy available. _The C Solution Book_
About 3/8" thick and fewer errata than the covers of Unleashed.
I'm curious what's at that link.
There's a worthwhile hard-copy available. _The C Solution Book_ About 3/8"Zach said:Thanks Richard.
Zach
Richard Heathfield said:Zach said:
Not complete (if I recall correctly) - but the Web site you're looking for
is:
<http://clc-wiki.net/wiki/K&R2_solutions>
#from the site [ <http://clc-wiki.net/wiki ]
The folks in comp.lang.c may tend to come across as Standard-thumping
fundamentalists, continuing to insist, with ramrod-straight demeanor,
that all code be strictly conforming, as if it's only important for its
own sake. But the insistence is not merely for its own sake: much more
importantly, it's for the sake of code that's correct, not just in the
ANSI C Standard sense, but in the much more important "works reliably in
the real world" sense. As Steve Summit wrote on an occasion when this
issue came up, "I'm not a Standard-thumping fundamentalist who worships
at the altar of X3J11 because I'm an anal-retentive dweeb who loves
pouncing on people who innocently post code containing void main() to
comp.lang.c; I'm a Standard-thumping fundamentalist who worships at the
altar of X3J11 because it gives me eminently useful guarantees about the
programs I write and helps me ensure that they'll work correctly next
week and next month and next year, in environments I haven't heard of or
can't imagine or that haven't been invented yet, and without continual
hands-on bugfixing and coddling by me.
#end excerpt
Richard refers to the standard in the singular here.
What catches my eye though is 3J as oppsoed to J3. Does X3J11
actually exist?
Zach said:I recall someone posting a website that had the complete K&R (2nd Ed.
- ANSI) answers posted but I cannot find the post.
==> printf("Bits of Char %d\n", CHAR_BIT);Ioannis said:Well about a K&R2 exercise posted in another thread. I think the answer:
http://clc-wiki.net/wiki/K&R2_solutions:Chapter_2:Exercise_1
#include <stdio.h>
#include <limits.h>
int
main ()
{
printf("Size of Char %d\n", CHAR_BIT);
printf("Size of Char Max %d\n", CHAR_MAX);
printf("Size of Char Min %d\n", CHAR_MIN);
printf("Size of int min %d\n", INT_MIN);
printf("Size of int max %d\n", INT_MAX);
printf("Size of long min %ld\n", LONG_MIN); /* RB */
printf("Size of long max %ld\n", LONG_MAX); /* RB */
printf("Size of short min %d\n", SHRT_MIN);
printf("Size of short max %d\n", SHRT_MAX);
printf("Size of unsigned char %u\n", UCHAR_MAX); /* SF */
printf("Size of unsigned long %lu\n", ULONG_MAX); /* RB */
printf("Size of unsigned int %u\n", UINT_MAX); /* RB */
printf("Size of unsigned short %u\n", USHRT_MAX); /* SF */
return 0;
}
is wrong and a bit incomplete.
I think the correct one is:
More:
#include <stdio.h>
#include <limits.h>
int main ()
{
Well about a K&R2 exercise posted in another thread. I think the answer:
http://clc-wiki.net/wiki/K&R2_solutions:Chapter_2:Exercise_1
is wrong and a bit incomplete.
Richard said:Ioannis Vranos said:
Then why not submit your own version to the C wiki?
Richard said:Then why not submit your own version to the C wiki?
I can't find out how to create an account.
[snip]Ioannis Vranos said:Well about a K&R2 exercise posted in another thread. I think the answer:
http://clc-wiki.net/wiki/K&R2_solutions:Chapter_2:Exercise_1
#include <stdio.h>
#include <limits.h>
int
main ()
{
printf("Size of Char %d\n", CHAR_BIT);
printf("Size of Char Max %d\n", CHAR_MAX);
printf("Size of Char Min %d\n", CHAR_MIN);
printf("Size of int min %d\n", INT_MIN);
printf("Size of int max %d\n", INT_MAX);
printf("Size of long min %ld\n", LONG_MIN); /* RB */
printf("Size of long max %ld\n", LONG_MAX); /* RB */
printf("Size of short min %d\n", SHRT_MIN);
printf("Size of short max %d\n", SHRT_MAX);
printf("Size of unsigned char %u\n", UCHAR_MAX); /* SF */
printf("Size of unsigned long %lu\n", ULONG_MAX); /* RB */
printf("Size of unsigned int %u\n", UINT_MAX); /* RB */
printf("Size of unsigned short %u\n", USHRT_MAX); /* SF */
return 0;
}
is wrong and a bit incomplete.
I think the correct one is:
Keith said:The more serious problem is that the messages are worded incorrectly.
It prints, for example (on my system):
Size of int max 2147483647
2147483647 is not a size, it's an upper bound.
The two lines
printf("Size of int min %d\n", INT_MIN);
printf("Size of int max %d\n", INT_MAX);
should be replaced with something like:
printf("Range of int is %d to %d\n", INT_MIN, INT_MAX);
Reading was never your strong suit. The text does sound like you but looksRichard Heathfield said:stop said:
#from the site [ <http://clc-wiki.net/wiki ]
The folks in comp.lang.c may tend to come across as Standard-thumping
fundamentalists, continuing to insist, with ramrod-straight demeanor,
that all code be strictly conforming, as if it's only important for its
own sake. But the insistence is not merely for its own sake: much more
importantly, it's for the sake of code that's correct, not just in the
ANSI C Standard sense, but in the much more important "works reliably in
the real world" sense. As Steve Summit wrote on an occasion when this
issue came up, "I'm not a Standard-thumping fundamentalist who worships
at the altar of X3J11 because I'm an anal-retentive dweeb who loves
pouncing on people who innocently post code containing void main() to
comp.lang.c; I'm a Standard-thumping fundamentalist who worships at the
altar of X3J11 because it gives me eminently useful guarantees about the
programs I write and helps me ensure that they'll work correctly next
week and next month and next year, in environments I haven't heard of or
can't imagine or that haven't been invented yet, and without continual
hands-on bugfixing and coddling by me.
#end excerpt
Richard refers to the standard in the singular here.
I don't remember writing the above, and I'm reasonably sure I /didn't/
write the above. Any of it. The second half of it appears to have been
written by Steve Summit (presumably in a Usenet article). And the first
half? Well, I *might* have written it, but I don't think so.
In the common C extension that is fortran, the J3 committee is kind of likeIt certainly did, because it was the ANSI Committee that produced the C89
Standard. Whether it still does, I have no idea.
Yup. I dug it out today while I was moving crates of books. It's more likesantosh said:Do you mean /The C Answer Book/ by Clovis & Tondo?
stop said:In the common C extension that is fortran, the J3 committee is kind of likeRichard Heathfield said:stop said (quoting somebody else): [snip]As Steve Summit wrote on an occasion when this
issue came up, "I'm not a Standard-thumping fundamentalist who worships
at the altar of X3J11 because I'm an anal-retentive dweeb who loves
pouncing on people who innocently post code containing void main() to
comp.lang.c; I'm a Standard-thumping fundamentalist who worships at the
altar of X3J11 because it gives me eminently useful guarantees about the
programs I write and helps me ensure that they'll work correctly next
week and next month and next year, in environments I haven't heard of or
can't imagine or that haven't been invented yet, and without continual
hands-on bugfixing and coddling by me. [snip]
What catches my eye though is 3J as oppsoed to J3. Does X3J11
actually exist?
It certainly did, because it was the ANSI Committee that produced the C89
Standard. Whether it still does, I have no idea.
a benevolent politburo. I never saw anything that might motivate the name
except to see the letters reversed in X3J11.
stop said:Yup. I dug it out today while I was moving crates of books. It's
more like 5/8".
The authors are Tondo and Gimpel. Mr. Tondo's first name is Clovis.
I'm reasonably certain I've never met a Clovis before.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.