View previous topic :: View next topic |
Author |
Message |
s003apr Apprentice
Joined: 04 Oct 2002 Posts: 162
|
Posted: Sat Feb 22, 2003 3:34 pm Post subject: References for C/C++ newbie |
|
|
I am trying to learn to program in C/C++ (not as a class, just on my own time). I have managed to find a lot of fairly decent documentation, however, I find that all of the documentation is geared toward users programming in the windows/mac OS with and integrated development environment such as Borland C++.
Obviously, as a Linux user I want to learn to program in Linux using tools such as my text editor, make, and gcc/g++.
Does anybody know of some good references/tutorials that can help get a newbie started? Both online references and books/authors would be appreciated.
Thanks guys |
|
Back to top |
|
|
() l33t
Joined: 25 Nov 2002 Posts: 610
|
Posted: Sat Feb 22, 2003 4:19 pm Post subject: |
|
|
I haven't seen many C/C++ books which are particularly geared towards Integrated Development Environments really (at the least the ones I've read), on the other hand they normally don't discuss command line tools like make much.
I don't know which editor you're using, but you might want to check out the book on Vim (http://www.newriders.com/books/opl/ebooks/0735710015.html), which contains some helpful info for programmers. Also, Accelerated C++ seems like a good starting point for learning C++ to me. |
|
Back to top |
|
|
aja l33t
Joined: 26 Aug 2002 Posts: 705 Location: Edmonton, Canada
|
Posted: Sat Feb 22, 2003 5:09 pm Post subject: |
|
|
A link:
http://www.doc.ic.ac.uk/~wjk/C++Intro/
Generally speaking, most "Linux Programming" books focus on C or Shell programming, not on C++. That being said, most of them would also be valuable in terms of helping learn the editors/environments and how to use the compiler. After that, any good C++ language reference (even your ones that point to Borland or VS) should be sufficient. I recommend the "Linux Programming Bible" for the first task.
I think that, if you spend a little time becoming comfortable with an editor (vi, emacs, whatever), how to invoke and control gcc/g++, make files, and gdb you should be well on your way to programming in the Linux environment in ANY language. You might then want to move to more baroque tools like kdevelop, anjuta, and ddd.
PS - I would avoid the most common document that turns up in web searches: "C++ Programming HowTo" - it seems to mostly be about how to make your C++ more like Java. |
|
Back to top |
|
|
s003apr Apprentice
Joined: 04 Oct 2002 Posts: 162
|
Posted: Sat Feb 22, 2003 8:13 pm Post subject: |
|
|
Quote: | Generally speaking, most "Linux Programming" books focus on C or Shell programming, not on C++. |
I had always been led to believe by others that C++ is a preferred and more powerful language and was therefore generally preferred over C.
So why are most linux apps written in C? Is it just a language that more ppl are trained in? |
|
Back to top |
|
|
PowerFactor Veteran
Joined: 30 Jan 2003 Posts: 1693 Location: out of it
|
Posted: Sat Feb 22, 2003 8:52 pm Post subject: |
|
|
s003apr wrote: | I had always been led to believe by others that C++ is a preferred and more powerful language and was therefore generally preferred over C.
So why are most linux apps written in C? Is it just a language that more ppl are trained in? |
I think it's because the linux kernel and most of the basic system apps were originally written in C. Partialy because C++ was not well standardized at the time, and C has been the "language of unix" from the beginning. There are a lot of linux apps written in C++ though, like kde and qt for instance. And C++ is not inherently better than C, they both have their strengths and weaknesses. (Insert myriad flame wars here. ) |
|
Back to top |
|
|
Lovechild Advocate
Joined: 17 May 2002 Posts: 2858 Location: Århus, Denmark
|
Posted: Sat Feb 22, 2003 9:09 pm Post subject: |
|
|
I really liked "Sams Teach yourself C++ for Linux in 21 days" |
|
Back to top |
|
|
aja l33t
Joined: 26 Aug 2002 Posts: 705 Location: Edmonton, Canada
|
Posted: Sat Feb 22, 2003 11:56 pm Post subject: |
|
|
[quote="s003apr"] Quote: | G
I had always been led to believe by others that C++ is a preferred and more powerful language and was therefore generally preferred over C. |
A commonly heard view. I've always thought of programming languages as tools - and in most situations one tool is better than another, but not always the same tool. Sometimes you need a screwdriver, sometimes a wrench. And sometimes a pnuematic wrench. C++ is a remarkably powerful language - it is usually my choice for large, feature-rich projects. However, for many simple console-based utilities that do one task well, C is a useful tool for producing a very tight, very efficient executable.
That (as well as historical reasons) is one of the reasons C is still the language of choice for the kernel and many system utilities on Unix-like system.
In fact, when I write a simple demonstration program in C++ (if I don't find the need for a class), then what I am writing would probably only need trivial changes to compile as a C program.
(I should add a postscipt that, nowadays, I tend to do those small little programs in Python). |
|
Back to top |
|
|
[smeagol] Apprentice
Joined: 24 Oct 2002 Posts: 152
|
Posted: Sun Feb 23, 2003 1:12 am Post subject: |
|
|
http://www.tempest-sw.com/cpp/
and also,
give Bruce Eckel's book "Thinking in C++" a try.
www.bruceeckel.com
The book by bjarne stroustrup is also good "The C++ Programming Langauge 3rd edition" but it costs money. _________________ In God We Trust, All Others We monitor. |
|
Back to top |
|
|
masseya Bodhisattva
Joined: 17 Apr 2002 Posts: 2602 Location: Baltimore, MD
|
Posted: Sun Feb 23, 2003 3:59 am Post subject: |
|
|
Learn C++ with Gentoo is helpful. _________________ if i never try anything, i never learn anything..
if i never take a risk, i stay where i am.. |
|
Back to top |
|
|
|