LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Im using pre C-ansi book.Should I purchase newer ... (https://www.linuxquestions.org/questions/programming-9/im-using-pre-c-ansi-book-should-i-purchase-newer-125497/)

xailer 12-13-2003 10:43 AM

Im using pre C-ansi book.Should I purchase newer ...
 
hi

Since Im learning C from book(almost finished reading it) written prior to C ansi standard,I was wondering if I should purchase a new book?

I realise function definitions have changed,but what about other things?

Are there only few changes or are there lots of changes,and
so buying newer book would be a must?

bye

Mara 12-13-2003 05:36 PM

C is rather simple language, that's why I think you don't need to buy a newer book. Just when writing first code use strict ansi compiliance (in gcc it's -ansi switch). That way you'll learn what's changed fast.
It's hard to say what changed since your book was released without knowing its title and print date. :)

xailer 12-14-2003 09:27 AM

hi

I wrote an old style function and using $cc -ansi hello.c command it should report error,but it didn't report any errors! Is this type of syntax ansi supported?

first(a)
int a;
{...}

Why is compiler ignoring ansi option?

thank you

PS:Im learning from C programming language(Brian W Kernighan),edition 1983

hiteshmaisheri 12-14-2003 09:49 AM

It is better to follow the ansi-c version of the book, that is the second edition of the book named The C Programming Language Kernighan & Ritchie

xailer 12-14-2003 12:36 PM

If I can get compiler to accept only ansi-c compliant code,then I think will be ok

Stack 12-14-2003 12:45 PM

K&R is the only book when it comes to learning C. Nothing compares to it.

xailer 12-14-2003 12:49 PM

well,from what I hear second edition is THE book:D,and ffirst edition was the book before ansi-c came along

Mara 12-14-2003 02:06 PM

Quote:

Originally posted by xailer

first(a)
int a;
{...}

Why is compiler ignoring ansi option?

It shouldn't even without -ansi. Could you paste the whole code you're trying?


All times are GMT -5. The time now is 03:45 PM.