LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 12-13-2003, 10:43 AM   #1
xailer
Member
 
Registered: Nov 2003
Posts: 77

Rep: Reputation: 15
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
 
Old 12-13-2003, 05:36 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,537

Rep: Reputation: 149Reputation: 149
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.
 
Old 12-14-2003, 09:27 AM   #3
xailer
Member
 
Registered: Nov 2003
Posts: 77

Original Poster
Rep: Reputation: 15
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
 
Old 12-14-2003, 09:49 AM   #4
hiteshmaisheri
Member
 
Registered: Nov 2003
Location: Kerala, India
Distribution: Red Hat, Knoppix, Mandrake, FreeBSD
Posts: 231

Rep: Reputation: 30
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
 
Old 12-14-2003, 12:36 PM   #5
xailer
Member
 
Registered: Nov 2003
Posts: 77

Original Poster
Rep: Reputation: 15
If I can get compiler to accept only ansi-c compliant code,then I think will be ok
 
Old 12-14-2003, 12:45 PM   #6
Stack
Member
 
Registered: Oct 2003
Distribution: FreeBSD
Posts: 325

Rep: Reputation: 30
K&R is the only book when it comes to learning C. Nothing compares to it.
 
Old 12-14-2003, 12:49 PM   #7
xailer
Member
 
Registered: Nov 2003
Posts: 77

Original Poster
Rep: Reputation: 15
well,from what I hear second edition is THE book,and ffirst edition was the book before ansi-c came along
 
Old 12-14-2003, 02:06 PM   #8
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,537

Rep: Reputation: 149Reputation: 149
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?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware book purchase vs. URL: http://www.slackware.org/book/ jtp51 Slackware 5 11-28-2004 04:30 PM
Pre card purchase preparation Rundi Linux - Wireless Networking 2 06-18-2004 10:09 AM
Ansi Telnet thebutler4 Linux - Software 1 05-25-2004 12:58 PM
Pre-purchase hardware nerves mbandrews Linux - Hardware 3 10-26-2003 03:04 PM
ANSI C Manual rajaram Programming 6 01-05-2002 07:39 PM


All times are GMT -5. The time now is 12:59 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration