LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-28-2010, 02:11 PM   #1
Super TWiT
Member
 
Registered: Oct 2009
Location: Cyberville
Distribution: Debian
Posts: 132

Rep: Reputation: 16
Good C++ Material?


I am want to learn c++ (I realize I won't learn it overnight) I have no programming experience, but I do have a fairly deep knowledge of computers. I would prefer the material be gcc friendly as I use linux, but I do have windows xp I COULD use. (I guess). Any Suggestions?

Last edited by Super TWiT; 03-28-2010 at 02:59 PM.
 
Old 03-28-2010, 02:43 PM   #2
ForzaItalia2006
Member
 
Registered: Dec 2009
Location: Walldorf, Germany
Distribution: (X)Ubuntu, Arch, Gentoo
Posts: 205

Rep: Reputation: 67
Hey,

first of all, here's (online) book about C++: http://www.planetpdf.com/developer/a...ContentID=6634

If you really want to use GCC on a Windows box, take a look cygwin or mingw.

Hope that helps,
Andi
 
Old 03-28-2010, 02:57 PM   #3
Super TWiT
Member
 
Registered: Oct 2009
Location: Cyberville
Distribution: Debian
Posts: 132

Original Poster
Rep: Reputation: 16
Thanks. I normally run linux, but I just wanted to let people know I COULD use XP (if forced). I'll edit the original post to make it more clear.
 
Old 03-28-2010, 03:37 PM   #4
JohnGraham
Member
 
Registered: Oct 2009
Posts: 467

Rep: Reputation: 139Reputation: 139
I found Thinking in C++ to be good, but I came to it from a programming background. It does have an introduction to C in it (and there's a Thinking in C seminar on Bruce Eckel's website), but I'm not sure how suitable it'd be to someone with no programming experience.

You might even want to consider learning C first - C++ is an absolute behemoth of a language, as it encompasses pretty much all of C (which is fairly large to start with), plus a lot of higher-level stuff - the result being that you have to deal with high-level and low-level programming at the same time, which is never an easy task.

If you want to learn C first, I found Sam's "Learn C in 21 Days" (or something like that) to be good as a beginner, and you wouldn't go wrong with K&R.

Also, a lot of C/C++ books are fairly compiler-independent, - here is a link to a good book on GCC. Just the start of the second chapter should be enough to get you started (so long as you're comfortable at a command-line - if not, get comfortable!), but the rest will be handy later on.

Last edited by JohnGraham; 03-28-2010 at 03:39 PM.
 
Old 03-28-2010, 03:54 PM   #5
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Debian, Mint, Puppy, Raspbian
Posts: 3,450

Rep: Reputation: 210Reputation: 210Reputation: 210
xp is far inferior to a unix OS for programming.
many more tools.

try:here

Last edited by bigearsbilly; 03-28-2010 at 04:05 PM.
 
Old 03-28-2010, 04:04 PM   #6
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
It is absolutely crazy to think programming in Windows is easier. It fact it was so difficult that I quit programming in compiled languages until I switched to Linux.

Windows's design goes completely against what you need for software dev, while Linux is basically designed form the ground up for programming.

Anyway, any C++ tutorial should do because as long as they use only the standard C library (and no Windows calls) the code will be the same on Linux and Windows. But of course the compilation process will be very different.

Compile a C++ source file:

g++ source.cpp

The exe will be named "a.out". You can specify the exe's name using the "-o <exename>" option, for example:

g++ source.cpp -o myprog

Now run it with this command:

./myprog

To compile multiple source files:

g++ source1.cpp source2.cpp source3.cpp -o myprog

Remenber, list only the C++ files, not header files! g++ will find them automatically based on the #include's in the source files.

Last edited by MTK358; 03-28-2010 at 04:11 PM.
 
Old 03-28-2010, 09:30 PM   #7
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by MTK358 View Post
...
Compile a C++ source file:

g++ source.cpp

...

No, not this way, but rather

Code:
g++ -Wall -Wextra source.cpp
.

...

To the OP - you better either start from plain "C", or learn both "C" and C++ in parallel - C++ is an almost strict superset of C99.

Knowing "C" helps to understand what "indeed" is happening, i.e. IMO one should understand how C++ constructs can be implemented in "C". Initially C++ was implemented as a preprocessor converting it into "C".
 
Old 03-28-2010, 09:42 PM   #8
icecubeflower
Member
 
Registered: Mar 2008
Location: USA
Distribution: Slackware 13.1
Posts: 313

Rep: Reputation: 34
Here is the greatest C++ tutorial in the history of the internet:
http://www.icecubeflower.com/cplusplus.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux Material kottana.swarnakumar Linux - Newbie 2 04-14-2009 05:20 AM
Need material to styudy pavan.manipal Linux - Newbie 7 04-06-2009 02:05 AM
good reading material to learn linux basics? Sir Robin Linux - Newbie 6 02-04-2006 04:57 AM
good reference material r_hartless Linux - Newbie 2 07-05-2005 02:48 PM
Some good reading material Seiken Linux - Newbie 1 04-07-2005 03:45 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration