[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: C Programming





fredex wrote:

On Sat, May 08, 2004 at 10:46:37PM -0400, Wade Chandler wrote:
Gene Heskett wrote:

On Saturday 08 May 2004 06:27, Trevor McNamara wrote:

Hello,

I am unsure if this is the correct post for this sort of question.
If not can someone please direct me in the right direction?

I was wondering if anyone would know anywhere that I can download a
guide for an INTRO to C programming, As I would like to know C, then
I can understand some of the source code for UNX/LINUX?

I have done a little bit of VB programming but nothing in C.

Any help on this would be great.

Thanks.
I think most of what I have came from the bookstores. I've got probably 500+ dollars in so-called C textbooks on the shelf right now.

Start with the one from Herbert Schildt, then fill in the gaps with

Not to be a negative-sounding force here, but I would urge you to NOT
ever use any of Herbert Schildt's books.

Mr. Schildt is a skillful writer, his writing is clear and lucid. He
writes books on C and  C++ that very easily and clearly lead you down
the path to writing programs that are WRONG. he teaches bad practice in
C and C++ in clear and easily understood ways, such that if you follow
his advice you will learn his bad habits. one minor example is that he
is one of the many people who incorrectly teach that it is permissible
to declare main() as being of type void:
	void main (void)
		{
		...
		}
A little web searching, or spending a little time on groups.google.com
reading comp.lang.c will find you plenty of examples of why his books
are not a good way to learn C or C++. You can learn, in the same way,
of many other books that do teach the language(s) correctly.

Please explain why main cannot be of type void.

Unless it is returning a value [ void main () ] or receiving a value [ void main( argv, argc ) ] , it should be void.

Main should be declared as any function within C. It should be typed to returhn a value *if* it does, and to accept parameters *if needed*.

While I agree main is most often typed to int for the purpose of returning a value designating completion with no errors or an error, there is no *requirement* for that.

If you can provide *definitive documentation* of your statement that his teaching is wrong in the requirements for function main() I would like to see it.

whatever pulls your trigger standing in front of the rack at Barnes & Noble etc. The first purchase should also include a copy of K&R #2. It should be used as the argument settler in case of confusion. Everything else is just so much, often way more verbose, frosting on the cake.

I looked at some VB code the other night that a friend was working on. Quite a lot being done in 100 lines of code, but I've never seen such a batch of spagetti in my life. Crap used but not pre-defined all over the place. Half an hour of talking about it to Jim and I had a headache. That stuff could convert a well trained programmer into a blithering idiot. Scarey.

Building on this reply....

I have always liked Herberts books as well. You can read his C++ bible and get up to speed on the necessities of C++ in a couple of evenings....in my opinion anyways. As far as pure C goes I don't know ... a good starter would be

The C Programming Language
Brian W.Kernighan and Dennis M. Ritchie(original C creator and Unix implementor)
Prentice Hall
ISBN 0-13-110362-8

Which is one of the best C books because it is essentially the instruction manual for the language from two of the original Unix C team at Bell labs.

For info on the book:
http://cm.bell-labs.com/cm/cs/cbook/index.html

For some history:
http://cm.bell-labs.com/cm/cs/who/dmr/chist.html

Wade





--
fedora-list mailing list
fedora-list redhat com
To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]