LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   ANSI C Manual (https://www.linuxquestions.org/questions/programming-9/ansi-c-manual-9656/)

rajaram 12-05-2001 08:49 AM

ANSI C Manual
 
I am using redhat linux version 7.1

Is it possible to write programs completely based on ANSI C. Where can i get the ANSI C manual?

Thanks,
Rajaram.

gui10 12-08-2001 06:16 AM

i believe u can use the gcc compiler that should have come with your default installation... that should be ANSI C compliant...

i am not sure where to get the ANSI C manual though...

i'm sure someone who knows will come along soon enough...

pinoy 12-10-2001 01:29 PM

There is an option in gcc to compile ANSI C only (I think it's --ansi, consult the man pages). You can also use --pedantic.

As for the ANSI C reference, you'll have to buy it from the ANSI standards, consult the comp.lang.c FAQ, I'm sure they have an address for ANSI and how to get the standard. If you just want the ANSI C library reference, there is a book by PJ Plauger named The Standard C Library, it has a complete implementation of the C library plus the standard text. It is a very dry read however, and should only be used as a reference.

ferrous 12-16-2001 03:29 PM

I'm pretty sure that you don't want the ANSI C standards, though. It's a good reference if you want to build a C compiler, not as useful if you want to write a program in the language.

I imagine you want an authoratative text from which to learn C, like the Visual Basic programmers manual. It's just my guess, given the inherent newbieality of your post.

In that case, I'd recommend Kernighan & Ritchie's
The C Programming Language, but there are plenty of other books that can be used to learn the language. C isn't as authoritarian as VB, and very few books are going to outright lie about anything.

That being said, I recommend against the O'Reilly book "Practical C Programming" or whatever its called. O'Reilly and Co. put out some good material, but every once in a while they screw up. Also, please don't get anything by a man named Herbert Schildt. He mainly writes C++ books badly, but he's been known to write books on C badly as well.

And don't worry about the mysterious K&R C and how its incompatible with ANSI C. You'd have to go digging to find a book that doesn't focus on the ANSI version. Even Kernighan and Ritchie's book only mentions the older, more cumbersome style.

Also, someone mentioned the reference book on the ANSI library. They're right. It's a very dry read, and probably won't be too helpful. You've got Redhat: you've got the manpages. Type

man man

at your prompt for more information. Try

man 3 printf

and

man 2 malloc

after that.

RussellJohnston 12-23-2001 09:33 AM

Harbison & Steele
 
Harbison & Steele, C: A Reference Manual, 4th ed., 1995, Prentice-Hall.

"Our aim is to provide a complete discussion of the language, the run-time libraries, and a style of C programming that emphasizes correctness, portability, and maintainability."

Includes information on Standard C vs. "traditional" C, (which can be helpful if you ever maintain or study old code) and on C++ compatability issues. Reference as opposed to tutorial, but includes many examples giving advice and pointing out pitfalls. Very clear writing and organization. This book is a thing of beauty!

ericn 12-23-2001 11:00 AM

I have found
 
Sams-Teach Yourself C for Linux Programming in 21 days, a good way to start and
C Programming -A Modern Approach by KN King as a good follow up to delve into the concepts a little more thoroughly.

btw-Pointers are a pain

late
eric

tyler_durden 01-05-2002 07:39 PM

if you are just looking for a basic c tutorial i recommend my favorite c tutorial cite here


All times are GMT -5. The time now is 07:23 AM.