Jump to content

Suggestions for Learning C++


16 replies to this topic

#1 Okie135

    Member

  • PipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 231 posts
  • LocationMercenary Training Command, Outreach

Posted 21 May 2012 - 07:35 PM

A little background. Last semester I chose to learn C# instead of C++. I already know Java, and I have dabbled some in C and MIPS assembly. However, my C instructor was... lets say inexperienced on the teaching side. (Grad Student) I really didn't learn much and still have a hard time with pointers. Half my class and I used to go talk to another instructor after C was done so we could learn things like that.


Anyway I'm looking into XNA and other game libraries/engines. C++ is used in CryEngine 3. It is free for non-commercial use, so I went ahead and downloaded it.

For people who already know C++, are there any books you would suggest? Any tutorials? I'd appreciate your suggestions on where to get started.

#2 Krivvan

    Member

  • PipPipPipPipPipPipPipPipPip
  • Littlest Helper
  • Littlest Helper
  • 4,318 posts
  • LocationUSA/Canada

Posted 21 May 2012 - 07:49 PM

If you know C and you know OOP (from Java) then you should be able to pick up C++ pretty easily. I also assume that you understand how headers work (.h vs .cpp). Definately get a concrete understanding of pointers though, that's not something you want to leave till later. Understand the difference between the pointer itself, the address and the actual content.

Personally I learn best by figuring out as I go, so I don't know any books to recommend.

Try not to jump directly into XNA or other libraries/engines until you've had at some some experience with simpler APIs like OpenGL or Java Swing.

Edited by Krivvan, 21 May 2012 - 07:49 PM.


#3 Okie135

    Member

  • PipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 231 posts
  • LocationMercenary Training Command, Outreach

Posted 21 May 2012 - 10:31 PM

Well that's the first time I've heard someone call Swing simple. :P

Conceptually I get pointers, it's the syntax and how it changes that gets confusing. (Spending hours looking for not a parenthesis but an * can be tedious if you don't understand when to use the asterisk and when not too...) I've got the object oriented stuff down, but headers? Is it like importing or 'using' libraries? Guess I have some research to do.

#4 Adridos

    Member

  • PipPipPipPipPipPipPipPipPipPipPip
  • Bridesmaid
  • 10,635 posts
  • LocationHiding in a cake, left in green city called New A... something.

Posted 21 May 2012 - 11:38 PM

Well, if you have the basics of C#, thenn you (sort of) already know C++, as those are two of the same language, just the C++ was designed to be easier to handle, more user friendly and saving time. :P

#5 Magnificent Bastard

    Member

  • PipPipPipPipPipPipPip
  • 542 posts
  • LocationInner Sphere

Posted 22 May 2012 - 03:31 AM

This site while basic seems excellent. I myself am learning C++ (but I've been very lazy at it so I might as well start over >_>).

#6 VvFreezervV

    Rookie

  • 5 posts

Posted 22 May 2012 - 08:07 AM

Can't speak to the differences with C# (going that direction in learning, myself), but the easiest way for me to understand C / C++ was to grok the reason that things are the way they are.

F.ex., pointers stemming from computer architecture / MMU, and headers / file organization coming from how the various bits of the compiler work.

YMMV, but imho it's a lot easier to just learn a summary of computer architecture's underpinnings that it is to learn all the exceptions / quirks of unmanaged languages individually.

Edited by VvFreezervV, 22 May 2012 - 08:07 AM.


#7 MEGAWEAPON

    Member

  • Pip
  • 12 posts

Posted 22 May 2012 - 12:25 PM

View PostAdridos, on 21 May 2012 - 11:38 PM, said:

Well, if you have the basics of C#, thenn you (sort of) already know C++, as those are two of the same language, just the C++ was designed to be easier to handle, more user friendly and saving time. ;)



c# is really nothing like c++, it's more like java actually, the only similarity is some of the syntax, and don't try to learn c++ using visual c++, there is tto much windows crap that has nothing to do with c++, just get a basic compiler, text editor

Edited by MEGAWEAPON, 22 May 2012 - 12:26 PM.


#8 Adridos

    Member

  • PipPipPipPipPipPipPipPipPipPipPip
  • Bridesmaid
  • 10,635 posts
  • LocationHiding in a cake, left in green city called New A... something.

Posted 22 May 2012 - 01:18 PM

View PostMEGAWEAPON, on 22 May 2012 - 12:25 PM, said:



c# is really nothing like c++, it's more like java actually, the only similarity is some of the syntax, and don't try to learn c++ using visual c++, there is tto much windows crap that has nothing to do with c++, just get a basic compiler, text editor


I think I'm fine with Pascal right now. I can save C++ for the university. :o

#9 Five by Five

    Member

  • PipPipPipPipPip
  • 191 posts

Posted 22 May 2012 - 01:42 PM

I used Deitel,... way back when.
http://www.deitel.co...46/Default.aspx

#10 Okie135

    Member

  • PipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 231 posts
  • LocationMercenary Training Command, Outreach

Posted 22 May 2012 - 05:36 PM

@Adridos, C# was built from the ground up to be an object oriented language using the .Net framework and Just In Time compiling. C++ used to be called C with classes. C# is in many ways easier, because instead of trying to act like you are object oriented, the language already is, and for all of Microsoft's faults (they are legion) one of the things they did a really good job on was Visual Studio. I don't really get C++ yet, but I did have to study the differences LoL.

@ Magnificent Thanks for the link. I'm not sure why, but Eset is tagging it as malicious. Just fyi.

@five by five Someone irl recommended Deitel as well.

Thanks for the quick responses everyone. :P

#11 HilaryPL

    Member

  • PipPip
  • 40 posts
  • LocationPoland

Posted 23 May 2012 - 10:24 AM

Search for english version of "Symfonia C++" by Grębosz.
Brillant book :lol:

#12 TheCrovax

    Member

  • PipPipPip
  • 98 posts
  • LocationSwitzerland

Posted 23 May 2012 - 11:42 AM

C/C++ are unmanaged languages without a garbage collector where the main difference with managed languages like the .NET ones are that you have to allocate / deallocate the memory yourself.

Just search a good Q&A Site like stackoverflow.com for "learning c++" and you'll find plenty of good lecture. oreilly.com / manning.com also have good ressources.

If you don't need the high performance of unamanged languages (Which come at the cost of being very complex to do it right) just stick with C# which is also very powerful.

#13 Magnificent Bastard

    Member

  • PipPipPipPipPipPipPip
  • 542 posts
  • LocationInner Sphere

Posted 23 May 2012 - 12:45 PM

View PostClark, on 22 May 2012 - 05:36 PM, said:

@ Magnificent Thanks for the link. I'm not sure why, but Eset is tagging it as malicious. Just fyi.

Odd. I've gotten nothing malicious from that link... but I am running Firefox with NoScript and a few other addons which are probably protecting me.

#14 HilaryPL

    Member

  • PipPip
  • 40 posts
  • LocationPoland

Posted 23 May 2012 - 01:10 PM

Remember- to write, you must write!

#15 A6PackofToucans

    Member

  • PipPipPipPipPip
  • 198 posts
  • LocationPA

Posted 24 May 2012 - 03:36 PM

Well, there may be one way to learn C++.....

Posted Image

#16 New Troski

    Rookie

  • 4 posts

Posted 24 May 2012 - 04:25 PM

Header files are kind of like the interface for a class, but in C++ there's no real restriction or enforcement of what goes where. You can declare things and implement things in either file, but that is generally considered bad practice - declarations should be in the .h and the implementation in the .cpp.

As for books, I'd recommend C++ Primer Plus. Several people in my office have a copy for reference (I'm a programmer at a game studio).

Using Visual Studio isn't bad in and of itself, but I would stay away from trying to make a Windows program when starting out (besides, that's a lot easier in C# for most things). I'd also recommend using another compiler as well, like Gnu. There are differences in the various compilers, and you will learn more about the language by making your code compile cleanly with all of them. Speaking of "compile cleanly," my last recommendation is to use the most strict settings, i.e. all errors turned on and treat warnings as errors. This is what we had to do at school, and while it was a pain, looking back I realize it was a valuable learning tool.

#17 gimmervan

    Rookie

  • 1 posts

Posted 14 March 2013 - 11:14 PM

View PostClark, on 21 May 2012 - 07:35 PM, said:

A little background. Last semester I chose to learn C# instead of C++. I already know Java, and I have dabbled some in C and MIPS assembly. However, my C instructor was... lets say inexperienced on the teaching side. (Grad Student) I really didn't learn much and still have a hard time with pointers. Half my class and I used to go talk to another instructor after C was done so we could learn things like that.


Anyway I'm looking into XNA and other game libraries/engines. C++ is used in CryEngine 3. It is free for non-commercial use, so I went ahead and downloaded it.

For people who already know C++, are there any books you would suggest? Any tutorials? I'd appreciate your suggestions on where to get started.


Microsoft XNA is a set of tools with a managed runtime environment provided by Microsoft that facilitates video game development and management. XNA is based on the .NET Framework.XNA typically involves several complex concepts that you may not be ready for right away. I would advise starting with something like a simple Console application, then WinForms/WPF, and then finally XNA after you have a grasp on C# http://csharp.net-informations.com and the .NET framework. Sp make experienced in C# XNA and then move to other languages.

gimmer.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users