Results 1 to 10 of 12
Hey guys,
I am trying to learn C since well I have enjoyed 'programming' before, (by that I mean vb ) and I am studying through.
http://www.faqs.org/docs/learnc/index.html
This document has ...
- 09-01-2008 #1
Learning C
Hey guys,
I am trying to learn C since well I have enjoyed 'programming' before, (by that I mean vb
) and I am studying through.
http://www.faqs.org/docs/learnc/index.html
This document has heaps of great info, but I think that if I don't apply it to anything that i will just forget it and hate it.
What I am looking for is sites that have examples and practice exercises so I have something to apply my knowledge to. Sort of like: this is the data from a season of the local sport teams. matches, team names, points scored etc, make a program to sort this data out is blah order. Yes that is something that I will trying to make when I get to it.
Obviously since I am just starting, basic stuff would be great, esp if it helps build upon previous activities.
Any help would be much apreciated.
- 09-01-2008 #2
Have you looked at everything on that site?
I see examples there. You should be able to build off of that.
- 09-01-2008 #3Linux Newbie
- Join Date
- Jul 2008
- Location
- Anaheim, CA
- Posts
- 114
i'm not sure of the difference between GNU C, and the other (i guess proprietary one?) What you learn on one, can you use on the other? (Want to learn C++, though...)
- 09-01-2008 #4
I was going to try to see what I can do with the examples that are listed there, though I was hoping for other activities to build off of to. Things that I wouldn't have thought of as such.
Simply these examples are kind of specific to 1 thing i.e loops, or if statements. I am looking for activities that combine it together.
- 09-01-2008 #5Just Joined!
- Join Date
- Aug 2008
- Posts
- 10
I would suggest you to start a thread and ask people to test you with questions on c
- 09-01-2008 #6
Both C and C++ have been standardized languages (ANSI/ISO) for some years now and any recent compiler should obey these standards. However, most of them bring about some unique extension and there are more than one revision of these standards.
Every decent compiler has a "switch" to make him disable his proprietary extension and only behave as the standard says. (Which has only minor effects most of the time.)
For example, to make sure the GNU C Compiler uses only the ANSI C standard released in 1989 (called C89), one would supply the option switch "-ansi". If your code compiles correctly, it should also be compilable on any other conformant C compiler and behave the same way.
But as I said before, even with their extension the differences are negligible in most cases, so it doesn't really matter on what compiler you learn. (I recommend, as always, GNU software
)
- 09-01-2008 #7
- 09-01-2008 #8
As you might guess, we get a lot of questions on good ways to learn C. And since I have yet to find a website that satisfies me, I always fall back to this:
There is a book called The C Programming Language. It is written by Brian Kernighan & Dennis Ritchie. Dennis Ritchie is the creator of the C language. There really is no greater authority on C than this book.
The book covers ANSI C, beginning at the beginning, and going through lots of cool things. It's a short book, but as they say, C is a short language. They do spend some time towards the back of the book discussing some POSIX-specific functionality (basically, the unistd.h header), which is also interesting.
There are lots of tasks for the reader, some of which are rather difficult, and though solutions aren't included, you can find them all online.
This is the book I used to teach myself C, and I really can't recommend it enough.
Having said all of that, if all that you're looking for are bigger example problems, I suggest re-implementing standard UNIX utilities. Write your own versions of cat, ls, head, tail, cp, mv, etc. Once you've learned enough, write a shell. It's a great way to explore more, and since you're basing it on an existing utility, its easy to make sure it's working correctly.DISTRO=Arch
Registered Linux User #388732
- 09-01-2008 #9
Thanks Cabhan.
I will have a look for that book. I think I still have a C for dummies book somewhere. Though I have a feeling its still at the parents place from when I moved out. *Crosses fingers*
I like the idea though of writting my own commands for practice and making shells.
- 09-02-2008 #10Linux Enthusiast
- Join Date
- Oct 2004
- Posts
- 609
There is a difference in learning C or C++.
Both languages have their own characteristics.
If you want to learn C++ and do not have any knowledge on C, don't learn C (and I guess that it is the same way around).


Reply With Quote

