Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
References for C/C++ newbie
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
s003apr
Apprentice
Apprentice


Joined: 04 Oct 2002
Posts: 162

PostPosted: Sat Feb 22, 2003 3:34 pm    Post subject: References for C/C++ newbie Reply with quote

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
View user's profile Send private message
()
l33t
l33t


Joined: 25 Nov 2002
Posts: 610

PostPosted: Sat Feb 22, 2003 4:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
aja
l33t
l33t


Joined: 26 Aug 2002
Posts: 705
Location: Edmonton, Canada

PostPosted: Sat Feb 22, 2003 5:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
s003apr
Apprentice
Apprentice


Joined: 04 Oct 2002
Posts: 162

PostPosted: Sat Feb 22, 2003 8:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
PowerFactor
Veteran
Veteran


Joined: 30 Jan 2003
Posts: 1693
Location: out of it

PostPosted: Sat Feb 22, 2003 8:52 pm    Post subject: Reply with quote

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. :twisted: )
Back to top
View user's profile Send private message
Lovechild
Advocate
Advocate


Joined: 17 May 2002
Posts: 2858
Location: Århus, Denmark

PostPosted: Sat Feb 22, 2003 9:09 pm    Post subject: Reply with quote

I really liked "Sams Teach yourself C++ for Linux in 21 days"
Back to top
View user's profile Send private message
aja
l33t
l33t


Joined: 26 Aug 2002
Posts: 705
Location: Edmonton, Canada

PostPosted: Sat Feb 22, 2003 11:56 pm    Post subject: Reply with quote

[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
View user's profile Send private message
[smeagol]
Apprentice
Apprentice


Joined: 24 Oct 2002
Posts: 152

PostPosted: Sun Feb 23, 2003 1:12 am    Post subject: Reply with quote

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
View user's profile Send private message
masseya
Bodhisattva
Bodhisattva


Joined: 17 Apr 2002
Posts: 2602
Location: Baltimore, MD

PostPosted: Sun Feb 23, 2003 3:59 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum