tags:

views:

302

answers:

11

I have a friend who wants to learn C++, but does not want to pay. I found Cplusplus tutorial, but I was wondering if there was any other material available for free.
I've had a look at Thinking In C++, but I feel it may be a bit advanced (totally new person).
Thanks.

+1  A: 

Online tutorials are often a good way to go.

http://www.cplusplus.com/doc/tutorial/

kbrimington
Along with lecture notes, slides, or even eBooks.
rlb.usa
rlb.usa, can you recommend any free eBooks then?
The Communist Duck
A: 

Google is the worlds #1 free educator. Google anything similar to "C++ tutorial", "C++ walkthrough", "learn C++", etc, and you'll find more than enough.

Fosco
However, what you find isn't necessarily good. Weeding out the bad ones is what this question is about.
sbi
Really? Have you found any bad free knowledge on learning c++?
Fosco
@Frosco: (You should properly @address others when you respond in comments. I have only found this by accident.) Are you pulling my leg? I'd estimate that at least four out of ten answers for C++ here on SO are either misleading or plain wrong and need to be corrected through comments. And there's some pretty bright C++ folks hanging out here to correct these. I have found bad online tutorials, bad tests, bad interview questions, _bad C++ books_ (and it's not only that Schildt guy) and whatnot. Very much of what you'll find is at least bad teaching, much is plain wrong when it comes to facts.
sbi
@Fosco: The big problem, although it's starting to go away, is teaching C++ as if it were a better C, or covering all the C stuff first, or trying to do something with C/C++ rather than just picking a language. That's a good way to maximize the chances that the reader can write neither good C nor good C++.
David Thornley
A: 

Check out Bruce Eckel's freely-available book Thinking in C++. It's not perfect, but it's a nice complement to other free C++ resources.

bcat
A: 

C++ is a very hard language as a first language. Do they know C -- I would definitely start there, and if so, with this:

http://www.highercomputingforeveryone.com/

Lou Franco
I would most definitely not start with C. I learned C++ before C, and I've taught C++ to students who didn't know C (but Java) or no programming language at all and that's perfectly fine. Coming from C, __you have to unlearn so many things__ which tends to make C programmers bad C++ programmers.
sbi
Very interesting sentence. I also have one **Comming from C++ to C you have to unlearn so many things** which tends to make C++ programmer bad C programmer. I learned Logo and Basic before learning Pascal, before learning assembler, before learning C, before learning Java, before learning C++, before learning shell languages, before learning Perl, before learning PHP, before learning Prolog, before learning Lisp, before learning Python. The list could go on, but I guess it's enough to make me very bad programmer with no chances to *unlearn* ;/
doc
If you know nothing, you have to learn if, for, variables, functions, operators, pointers, etc. That's hard enough without also having to learn C++ stuff which will make no sense. I learned C before C++ and C++ made sense because of the way I used C (I had to make thing that C++ gives you for free like virtual tables). There's a way to do it right.
Lou Franco
@Lou: If you're learning C++ stuff that makes no sense, you're doing it wrong. Using C++, you can put off pointers and dynamic allocation until later in the course, which is useful, and you can start with good data structures. You don't need to learn C string handling at first. You don't need to type-match in `printf()`. I'd say that getting to a reasonable level of proficiency in C++ is easier than in C.
David Thornley
I don't agree, and C++ programmers not understanding pointers scare me. Personally, I would never suggest a new programmer learn C or C++, but if I had to pick, I pick C. I meant C++ stuff that will make no sense to you until you learn C.
Lou Franco
Well, what benefits are there to start learning in C++ rather than C? I'm assuming you're going to start from the basics, so there shouldn't be much of a reason to start out in a more complicated language.
David Liu
A: 

I picked it up from cprogramming.com.

DeadMG
A: 

See resources list on "about c++" page at stackoverflow.com

Igor Oks
+1  A: 

If he/she is being introduced to the concept of programming for the first time, then I would really recommend Stroutrup's Programming -- Principles and Practice Using C++.

From author :
This book is for someone who has never programmed before but is willing to work hard to learn. It helps you understand the principles and acquire the practical skills of programming using the C++ programming language. My aim is for you to gain sufficient knowledge and experience to perform simple useful programming tasks using the best up-to-date techniques. How long will that take? As part of a first-year university course, you can work through this book in a semester (assuming that you have a workload of four courses of average difficulty). If you work by yourself, don’t expect to spend less time than that (maybe 15 hours a week for 14 weeks)

EDIT:
This book is not free, but the book impressed me as it teaches not only programming but also good practices and principles that it claims (you can go to nearest library or ask around to see if anyone has it)

Gollum
how is this free ?
Matthieu M.
Sorry, this is not free but wanted to mention just in case someone else is ready to spend some.
Gollum
+2  A: 

If this person is totally new to programming, I wouldn't start them off with C++ for one simple reason - you have to be exposed to all sorts of concepts (some advanced, others not as much) just to write the most basic program.

Consider the most basic "Hello World" program in both Python and C++:

Python:

print "Hello World!"

That's all there is - you tell the computer to print, and it does. Most people are used to writing commands or doing things similar to this every day.

C++:

#include <iostream>
using namespace std;

int main(){
    cout << "Hello World!" << endl;
    return 0;
}

Here are the things you're exposed to (you don't have to understand them, sure, but you're still faced with either accepting, ignoring, or fleeing in terror):

  1. Header files/inclusions.
  2. Namespaces
  3. Functions
  4. Operator overloading (you just don't know it yet)
  5. Return codes

And we haven't even begun to look at any of the real programming features like loops and branches.

That being said, I do enjoy C++ on occasion, but a link to this reference is a requisite.

Wayne Werner
+1  A: 

There is "free" and there is "free".

First of all, like many programming languages, you can find free C++ compilers and linkers which means you can write programs for free. I recommend writing as much as possible, there is nothing like practice.

Second, there are free resources available, but if it's easy to find documentation or reference (on the STL for example), I have found online tutorials lacking (some are far from comprehensive, other teach bad habits).

Often times people also talk of looking at free C++ software and page through the code: honestly it's hard... The good ones are coded for portability, with a lot of hacks for particular compilers that just clutter the code. And it's hard to know in advance if a particular library is good or not: its usefuleness or the fact it's widespread does not tell much about the quality of its design, and some are very performance-oriented with dirty hacks thrown in to get that extra kick: not something to be concerned about for beginners.

I do recommend taking a look at the Guru of the Week site, there are articles there that later went into Sutter's Exceptional C++ book ;)

Third, there are resources that are nearly free: you can always borrow a book from a friend or from a library, or get second-hand books at low rates. I do have the chance to work in a computer shop, which grants me access to its library, and its collection of programming books, for free, and I certainly used this as much I could. The caveat being that some books are a bit too advanced sometimes: mark them down until you feel ready to come back to them.

Finally, I personally recommend buying a few references book nonetheless. Perhaps not to begin with, but as soon as you'll get serious about programming in C++ you'll probably need a copy of "The C++ Programming Language". One cannot live on borrowed books forever.

Matthieu M.
A: 

I used LearnCpp.com.
It may not cover everything, but it's definitely useful, if only for reference on the syntax.

Alexander