I want to Learn C++, Anyone have a good beginner's guide?

Post » Sun May 13, 2012 8:50 pm

I am looking to learn C++. Could anyone recommend a good beginners guide to at least give me a solid foundation in it?
User avatar
jessica sonny
 
Posts: 3531
Joined: Thu Nov 02, 2006 6:27 pm

Post » Sun May 13, 2012 10:58 am

http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/

MIT has a few free online courses, don't know if any are C++ specifically.
User avatar
Conor Byrne
 
Posts: 3411
Joined: Wed Jul 11, 2007 3:37 pm

Post » Sun May 13, 2012 3:13 pm

http://www.cprogramming.com/tutorial.html

http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list

Jumping into C++ and expecting to be good if you have -zero- knowledge of programming beforehand will be very rough, especially without a good book on it. I'd suggest starting with something like a scripting language or more forgiving programming language. Something like php, ruby, or python.
User avatar
DAVId MArtInez
 
Posts: 3410
Joined: Fri Aug 10, 2007 1:16 am

Post » Sun May 13, 2012 9:23 pm

http://www.cprogramming.com/tutorial.html

http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list

Jumping into C++ and expecting to be good if you have -zero- knowledge of programming beforehand will be very rough, especially without a good book on it. I'd suggest starting with something like a scripting language or more forgiving programming language. Something like php, ruby, or python.

I don't expect to be good at it starting out. I am thinking Python will be a good place for me to start. :)
User avatar
TRIsha FEnnesse
 
Posts: 3369
Joined: Sun Feb 04, 2007 5:59 am

Post » Sun May 13, 2012 11:13 pm

If you've never programmed before, you could start with something like http://www.codecademy.com/#!/exercises/0. It doesn't teach C++, but for someone who has never programmed, that makes no difference whatsoever. It's a bit of a pet peeve, but I think people looking to start often obsess about languages way too much. In reality, once you have a solid grasp of the concepts behind coding and know one language, picking up another takes very little work.
User avatar
Laura Wilson
 
Posts: 3445
Joined: Thu Oct 05, 2006 3:57 pm

Post » Sun May 13, 2012 9:32 pm

Not to highjack this thread, but I had a similar question.

I'm graduating soon and planning to get a BS in Computer Science. Do those classes teach sufficient levels of programming for an entry level job? I was told I know more than the average computer science student (when they first start classes) by my school counselor. I built my first rig when I was 12, I'm even fixing the school issued laptops for other students (and getting credit for it). The only thing I don't know is how to program. Like at all.


If it helps at all, I'm planning on going to University of Alaska, Anchorage (pretty much the only college in alaska)
User avatar
Sunny Under
 
Posts: 3368
Joined: Wed Apr 11, 2007 5:31 pm

Post » Sun May 13, 2012 1:31 pm

im not good at programming either lol
User avatar
Lucky Girl
 
Posts: 3486
Joined: Wed Jun 06, 2007 4:14 pm

Post » Sun May 13, 2012 10:31 am

Ok I am learning Python I am just stuck on one thing here.

#EXAMPLE 2
print "We will show the even numbers up to 20"
n = 1
while n <= 20:
if n % 2 == 0:
print n
n = n + 1
print "there, done."

Am I right in saying that = pretty much means "is", and == means equal to?

So if I where to say y=1 it means y is 1. But if I say y==1 it means y is equal to 1. There is a difference here that I am not quite grasping. I am lost at the if part. What exactly would that be saying if you where to verbally communicate it in English?

This is the tut I am using btw.

http://www.sthurlow.com/python/lesson04/
User avatar
matt white
 
Posts: 3444
Joined: Fri Jul 27, 2007 2:43 pm

Post » Sun May 13, 2012 11:23 am

So if I where to say y=1 it means y is 1. But if I say y==1 it means y is equal to 1. There is a difference here that I am not quite grasping.

"y = 1" means "store the value 1 in the variable named y". It's a statement. "y == 1" is an expression meaning "whether y equals 1".
User avatar
JLG
 
Posts: 3364
Joined: Fri Oct 19, 2007 7:42 pm

Post » Sun May 13, 2012 1:34 pm

Not to highjack this thread, but I had a similar question.

I'm graduating soon and planning to get a BS in Computer Science. Do those classes teach sufficient levels of programming for an entry level job? I was told I know more than the average computer science student (when they first start classes) by my school counselor. I built my first rig when I was 12, I'm even fixing the school issued laptops for other students (and getting credit for it). The only thing I don't know is how to program. Like at all.


If it helps at all, I'm planning on going to University of Alaska, Anchorage (pretty much the only college in alaska)

Once you understand the basics of Programming, then picking up new langauges show be fairly easy....you stop seeing langauges as different, and just do the same thing in each one after learn the different syntax and quirks.

Also, as a current university student, I've found the more you dig into programming, the more there is, and the amount you need to know really depends on what sort of job you're after....and most of the time you won't know what you need to learn until you have the job. But as long as you have learnt how programming in general works, you shuold then be able to learn what you need once out there.
User avatar
Gaelle Courant
 
Posts: 3465
Joined: Fri Apr 06, 2007 11:06 pm

Post » Sun May 13, 2012 1:59 pm

"y = 1" means "store the value 1 in the variable named y". It's a statement. "y == 1" is an expression meaning "whether y equals 1".

ok, thanks.

What about.

"if n % 2 == 0"
User avatar
Jenna Fields
 
Posts: 3396
Joined: Mon Dec 11, 2006 11:36 am

Post » Sun May 13, 2012 9:34 am

ok, thanks.

What about.

"if n % 2 == 0"

In english.

If the remainer of vairable 'n' divided by 2 is 0 then do the next line, if not, dont do the next line.


Mod is a tricky concept to understand straight away.....basically its an integer (whole number) left over when dividing.
User avatar
Katie Pollard
 
Posts: 3460
Joined: Thu Nov 09, 2006 11:23 pm

Post » Sun May 13, 2012 10:44 pm

Am I right in saying that = pretty much means "is", and == means equal to?

So if I where to say y=1 it means y is 1. But if I say y==1 it means y is equal to 1. There is a difference here that I am not quite grasping. I am lost at the if part. What exactly would that be saying if you where to verbally communicate it in English?

This is the tut I am using btw.
A single = assigns the value given on the right. In Python you luckily don't need to deal with data types in declaration. So x = 1 means that the variable x has the value 1. An == returns either true or false if the value on the right is equal to the value on the left. You're using the % operator which, if it wasn't explained to you, gives the remainder after division. Not used too often.

Maybe this will clear things up for you somewhat.
>>> x = 1>>> y = 1>>> z = (x == y)>>> print zTrue>>>

As for some really awesome Python (and C++) tutorials, go to http://thenewboston.org/. Bucky rules.
User avatar
Devin Sluis
 
Posts: 3389
Joined: Wed Oct 24, 2007 4:22 am

Post » Sun May 13, 2012 2:04 pm

ok, thanks.

What about.

"if n % 2 == 0"
You program in plain english is:
  • Store the value 1 in the variable named "n".
  • While the value of the variable named "n" is less than or equal to 20, do items 3-5. Otherwise jump to item 6.
  • Divide the value of n by 2 and see whether the remainder equals 0. If it does, then do item 4. Otherwise skip 4 and go to item 5. The "%" is the modulus operator. It returns the remainder of the division of its left operand by its right operand (e.g. 5 % 2 == 1, 5 % 3 == 2, 5 % 4 == 1, 5 % 5 == 0). This line is the common check for an even number. If n is even, the remainder of its division by 2 is 0. Otherwise the remainder will be 1.
  • Print the value of the variable n.
  • Store the value of n plus 1 in n. I.e. increment the value of n. If n is 12 before this line, it will be 13 after it.
  • Print "there, done.".
In Python, instead of using numbers, you use indentation to specify which lines belong to which "blocks":
n = 1while n <= 20:  if n % 2 == 0:    print n  n = n + 1print "there, done."
The fact that the third, forth and fifth lines are indented shows that they belong to the while block, i.e. they are the commands to be executed while the expression in the while statement holds. Similarly, the double indentation of the "print n" line shows that it belongs the if statement above it (and that the "n = n + 1" line doesn't). Most other languages use braces to surround blocks instead.
User avatar
Sarah Kim
 
Posts: 3407
Joined: Tue Aug 29, 2006 2:24 pm

Post » Sun May 13, 2012 6:41 pm

A single = assigns the value given on the right. In Python you luckily don't need to deal with data types in declaration. So x = 1 means that the variable x has the value 1. An == returns either true or false if the value on the right is equal to the value on the left. You're using the % operator which, if it wasn't explained to you, gives the remainder after division. Not used too often.

Maybe this will clear things up for you somewhat.
>>> x = 1>>> y = 1>>> z = (x == y)>>> print zTrue>>>

As for some really awesome Python (and C++) tutorials, go to http://thenewboston.org/. Bucky rules.

Thanks so much, that cleared it up almost instantly for me. :D
User avatar
Izzy Coleman
 
Posts: 3336
Joined: Tue Jun 20, 2006 3:34 am

Post » Sun May 13, 2012 11:48 am

Back in the 1990s i used C++ For Dummies which was excellent for learning the basics in a very down to earth way. It also showed me how much C++ was like regular english and nothing like walls of numbers i was expecting that i read about Assembly language being.
User avatar
James Shaw
 
Posts: 3399
Joined: Sun Jul 08, 2007 11:23 pm

Post » Sun May 13, 2012 11:47 am

You program in plain english is:
  • Store the value 1 in the variable named "n".
  • While the value of the variable named "n" is less than or equal to 20, do items 3-5. Otherwise jump to item 6.
  • Divide the value of n by 2 and see whether the remainder equals 0. If it does, then do item 4. Otherwise skip 4 and go to item 5. The "%" is the modulus operator. It returns the remainder of the division of its left operand by its right operand (e.g. 5 % 2 == 1, 5 % 3 == 2, 5 % 4 == 1, 5 % 5 == 0). This line is the common check for an even number. If n is even, the remainder of its division by 2 is 0. Otherwise the remainder will be 1.
  • Print the value of the variable n.
  • Store the value of n plus 1 in n. I.e. increment the value of n. If n is 12 before this line, it will be 13 after it.
  • Print "there, done.".
In Python, instead of using numbers, you use indentation to specify which lines belong to which "blocks":
 n = 1 while n <= 20: if n % 2 == 0: print n n = n + 1 print "there, done." 
The fact that the third, forth and fifth lines are indented shows that they belong to the while block, i.e. they are the commands to be executed while the expression in the while statement holds. Similarly, the double indentation of the "print n" line shows that it belongs the if statement above it (and that the "n = n + 1" line doesn't). Most other languages use braces to surround blocks instead.

So am I right if I say % tells it to divide and show the remainder?
User avatar
James Baldwin
 
Posts: 3366
Joined: Tue Jun 05, 2007 11:11 am

Post » Sun May 13, 2012 7:50 am

Once you understand the basics of Programming, then picking up new langauges show be fairly easy....you stop seeing langauges as different, and just do the same thing in each one after learn the different syntax and quirks.

^

Took 2 semesters of programming in HS with the regular course then an AP class. Biggest thing I learned was not the coding itself, but actually learning how to "dissect" the code to tell me what does what. Going from C++ to CSS stuff for web design wasn't hard as I just needed to re-learn what commands did. After that it's a matter of studying code out there and making your own stuff since everything has a precise set of rules.
User avatar
Brian Newman
 
Posts: 3466
Joined: Tue Oct 16, 2007 3:36 pm

Post » Sun May 13, 2012 11:39 pm

So am I right if I say % tells it to divide and show the remainder?
Yep. Modulus operator returns the remainder of a divison.
User avatar
Alexandra Ryan
 
Posts: 3438
Joined: Mon Jul 31, 2006 9:01 am

Post » Sun May 13, 2012 4:38 pm

Yep. Modulus operator returns the remainder of a divison.

Awesome, thanks.
User avatar
jess hughes
 
Posts: 3382
Joined: Tue Oct 24, 2006 8:10 pm


Return to Othor Games