Im teaching myself C++. Got any good tips/good resources for me?

JengoJengo Pasco, WA | USA
edited December 2005 in Internet & Media
Well guys. Im beggining C++, currently im using the C++ for Dummies book i bought at Barnes and Nobles. im currently in the 3rd chapter, and its starting to get tricky, im trying to take it slow and absorb the knowledge into my brain. but i just want to learn it so fast!!!

Any good books on C++ or tutorials etc. that you guys reccomend? any tips and advice is very appreciated. i want to make this as painless as possible!!

thanks for your help guys! :thumbsup:

Comments

  • JBJB Carlsbad, CA
    edited October 2005
    Just take your time and enjoy it :)

    Make sure you get a good understanding of data types, if/else, loops, structures, arrays, and classes. The STL is also fun to look at to see lots of neat functionality already implemented. After that you can pretty much write whatever you want.

    Don't forget about google when you are looking for some code snippets, you will find tons of links and help!
  • mmonninmmonnin Centreville, VA
    edited October 2005
    cplusplus.com is a great website as well as Microsoft's MSDN website. If you dont know what an error code means just type in the CXXXX (where X's are numbers) and C++ into google and MSDN's website will usually be the firs link. Sometimes it can be helpful and sometimes it wont really tell you much.
  • mondimondi Icrontian
    edited October 2005
    Another thing to keep in mind is that just "learning" any programming language becomes tedious and pretty abstract very quickly unless you have some idea of what you'd like to do with it .. after learning the basics, set yourself little challenges and see if you can figure out how to solve them, that way you'll practice what you know, and learn other stuff while you're doing it.
  • tmh88tmh88 Pittsburgh / Athens, OH
    edited October 2005
    I bought the C++ for dummies that also comes with a cd-rom. I found it pretty helpful and it teaches you the basics. It basically just shows simple programs, and what each and every line does, and what it means. Its good for beginners, but once you understand this, you'll definately have to get an intermediate level book because this is just the basics. I would reccommend it and it was $20 or something like that

    :cheers:
  • BLuKnightBLuKnight Lehi, UT Icrontian
    edited October 2005
    Learning how to code properly in any language: (not language specific)
    Code Complete, Second Edition

    C++ Reference Book:
    Object-Oriented Programming in C++ (4th Edition)

    I think you'd really benefit from these books. They teach you good programming practices and a good reference book is fun to page through when you don't want to sit in front of the computer. I paged through the OOP in C++ book on my comfy couch and learned tons of stuff. Google.com filled in any gaps or quandries.

    I hope this helps. Of my many programming books, these are two I'd never part with... along with my PHP Bible. :)
  • JengoJengo Pasco, WA | USA
    edited October 2005
    Thanks for your help guys. I now know the basics of C++

    But... for some reason.. i am lost. Now that i know the very basics i dont know how to implement it to make a program... i can make very simple things like small programs to find averages and small programs to help with math.. but is this really what programming in C++ is?? it seems so boring... i mean... How do you implement this... say... into making a 2D game? or... some sort of web browser... or anything that doesnt involve Adding numbers in a Dos prompt... what i mean is... How do i get it visual!!?? how can i make things that look nice!? its just a black DOS box with letters and numbers.. ahhhh!!

    I feel so lost, i thought this was going to be way different. The whole reason why I wanted to learn C++ was to maybe make small 2D games and port them to many different types of OS's and maybe make a few small apps. but this isnt like i thought it would be... can you help me out guys?

    Oh, and learning C++ is HARD!!! any easy language out there that i might try and get into first? something that would let me get an understanding for programming a little more? cause i seem lost in a giant ocean there are so many questions i have... but a book cant answer questions..

    thanks for all your help guys.

    im gonna blow up!!

    :crazy: :bawling:
  • BLuKnightBLuKnight Lehi, UT Icrontian
    edited October 2005
    Hmmm.. Game programming you say. Well, before you can chew meat, you have to drink milk first. When learning to program, it's a really good idea to start small. "Hello World" and adding numbers are a good start. I like the list Radeon_Man provided. Try to create a few programs that incorperate the items in his list. You may also want to learn a bit more about how to create Windows programs with C++. I started by designing a few small programs with simple objectives. When you feel you can create and use classes, understand inheritance, and object oriented design, then find a book on game programming.

    If you're looking for an easier language, you could start with Java, although it's not a language that you'd want to stick with. You could also look at C#, which is much easier to design Windows programs in. Or, you can jump to PHP and make web pages. PHP is very similar to C++.

    Probably the best thing you can do is run down to Barnes and Noble and page through some books for a couple of hours. Use Amazon.com to find reviews on the books you like or point you in the direction of what books to look at.

    Ultimately, I'm probably not the best source for help with game design. I'm focusing on programs that interact with databases.

    Have fun.
  • mmonninmmonnin Centreville, VA
    edited October 2005
    Well the powerful parts of C++ dont come into play until you learn all the windows components. Learning the Windows Win32 API is actually where the good stuff comes. Learing all of that will take a VERY long time. I have C++ in HS and 2 class in college but I continually use it in a lot of my other class.

    Also have you learned Functions? Classes? Mastered Pointers? Linked Lists? Queues? File I/O? Then there is the Visual part of C++. Get yourself a Visual C++ book/tutorial to start with to learn how to get stuff from the labels in the program to the correct data types.

    C++ is VERY powerful. Games and your OS is written in C and Assembly. Did you know you can insert asembly into C++ code?

    _asm
    {
    inc i
    }

    is the same thing as i++ but i++ is actually 3 lines of assembly where you could use inc i instead. Thats just one example. But yeah you can edit the registers available to used by programs using a _asm assembly block inside of C++. Thats totally cool.

    Edit: Java Sucks! If you want something easier than C++ go with Visual Basic. Its pretty basic, thusly the name.
  • NosferatuNosferatu Arizona
    edited October 2005
    My recommendation would be to stick with C++ or switch to C#. C# would be a great first language to learn and its syntax is very similar to C++.
  • JengoJengo Pasco, WA | USA
    edited October 2005
    do you guys know of any open-source program that is done in C++? that maybe i could look at as reference?

    All the open-source apps i find are done in other languages...
  • BLuKnightBLuKnight Lehi, UT Icrontian
    edited October 2005
    mmonnin wrote:
    Edit: Java Sucks! If you want something easier than C++ go with Visual Basic. Its pretty basic, thusly the name.

    Yes, Java does suck. However, if you don't want to learn C#, Java is a good intro language. Luckily, I only had to take 3 semesters of it. I'm not a fan of Visual Basic. It's too easy and I don't think anyone can say they're a true programmer if they know VB.

    To answer Jengo's question. GCC is free. That coupled with VIM (a text editor) isn't too bad. If your looking for a more full blown IDE, then you may want to consider the Visual C++ 2005 Beta, which is currently free. If you want a free copy of Visual Studio 2005 when they launch, I hear that M$ is going to give away copies at the kickoff party.

    http://www.slickdeals.net/category/newdeals/?daysago=10#p6581
  • JengoJengo Pasco, WA | USA
    edited October 2005
    thanks Bluknight, now i have more compilers ;)

    but what i meant was, do you guys know of any applications that are done in C++ that are open source, so view its code. Like a full blown app done in C++ so i can look at how programmers utilize the commands im learning. it would be very helpfull to me, i cant seem to find one that is done in C++

    thx!
  • mmonninmmonnin Centreville, VA
    edited October 2005
    What about Linux? A teacher said it was done in assembly and C.

    I just mentioned BASIC because it is basic, just something to learn the general idea about programming.

    Yeah I have VS.net 2005 Beta which I got free but then I also have 2003 from school as well. There is a G++ compiler in Unix that I have used at school but VS is much easier to work with.
  • mondimondi Icrontian
    edited October 2005
    hit http://sourceforge.net/ and search for c++, youll find a ton of stuff immediately.
    It's too easy and I don't think anyone can say they're a true programmer if they know VB.

    thats not true at all, programming is not just about knowing a language, a good (true) programmer is someone who can analyze a problem, and come up with a good solution for it - regardless of the language that he chooses to implement it in. For the problem - write the words "hello world" on the screen, PRINT "hello world" is a lot better solution than:
     int main(void)
    {
       unsigned short binary[] = {
       0x8955, 0x60e5, 0x4d8b, 0xb808, 0x0004, 0x0000, 0x01bb, 0x0000,
       0xba00, 0x000c, 0x0000, 0x80cd, 0x5d61, 0x68c3, 0x6c65, 0x6f6c,
       0x7720, 0x726f, 0x646c, 0x000a};
       ((void(*)())binary)((char *)binary+27);
       return 0;
    }
    

    edit:// - heres a few more fun ones http://www.fitzrovian.com/hello.html
  • NLichtmanNLichtman Spring Valley, CA
    edited October 2005
    If you already know C than you should try your best to forget most of it...
  • mmonninmmonnin Centreville, VA
    edited October 2005
    Why is that?
  • tmh88tmh88 Pittsburgh / Athens, OH
    edited October 2005
    checkmate wrote:
    If you already know C than you should try your best to forget most of it...

    ? :scratch:
  • IamMrRayIamMrRay Otis, MA
    edited November 2005
    The C++ for dummies, Sam's Teach yourself in 21 days book, which is now free if you look hard enough legally I think too. Also goto a college bookstore and they should have really good books there.
  • GooDGooD Quebec (CAN) Member
    edited December 2005
    Just a tips or two, Ok reading books is great to learn... But to realy UNDERSTAND you should go on from eveything you read and try to make a little project with that... test it, looks what it does, look what it takes to compile, what you can do with it... I think this is the best way to get over the base of any programmation langage.

    Once you had one in mind, learning another one is done pretty easily. As other people around here, I would recommand to start from c#, and then you could more easily go 'backward' and go down the way to c++, and even c. You'll also have a good view of 'what it is now' (c#) compare to all of 'what it was' (C++, C...)

    EDIT : If you found c++ or c# a bit too tricky , some may say to go with VB... Personnaly i would not recommand it as it is the worst langage ever made. Not enough structure restriction, its like IE that will do whatever he can to show a page , even if what he gives as final result is not what you were waiting for... VB is not the good langage if you wanna be a GOOD programmer ;) It's use cuz it can makes sh*tty program really fast. At least if you do VB don't forget to put clause (i forget the name) to disable the auto-optimisation as it is the best way to make a program compile and not working well. If you still wanna start easily you could go with Borland Delphi (Pascal). This is the first langage i've ever learn and this is great to start learning the base of programmation in a 'good way' :rolleyes:

    That's realy how i made my way in the wonderful world of programmation. Don't hesitate to search google for any problem you have, as c# and c++ are well documented and have a lot of good forums for online help :)
  • Straight_ManStraight_Man Geeky, in my own way Naples, FL Icrontian
    edited December 2005
  • GooDGooD Quebec (CAN) Member
    edited December 2005
    Wow, great link Straight_Man :thumbsup:
Sign In or Register to comment.