Thread: Newbie ~ a problem with learning C++

  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    9

    Newbie ~ a problem with learning C++

    Well I have an interest in learning C++ programming, so I came to this site to learn what I can about it. As I go through these lessons, i find that I have learned a bit, but I have nothing to apply my new-obtained knowledge to. If anyone has a suggestion to what I can do to help me better understand the concepts placed out on the guides, I am only 15, but I don't think that effects my understanding of the material much. I am only on lesson about 8 and I'm confused at what to do with the information I am given in order to practice and perfect it. Please help if you can.
    Last edited by ultrablade12; 07-30-2008 at 03:19 PM.

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Keep writing programs. This topic is about C, so some things may not apply (such as reading through the K&R book), but the general advice should help you out.

    And no, being 15 won't stop you if you're a diligent worker, motivated, and really want to learn.

  3. #3
    Registered User
    Join Date
    Jul 2008
    Posts
    9
    thanks for your input

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Also bear in mind that C++ is a difficult language to learn completely. Whilst there are books called the likes of "Learn C++ in 21 days", I do not beleive that is realistic, even if you work 15 (or 24) hours a day for 21 days - it will still be a lot of intimate details of how the language works that will be missing in your understanding.

    Working with the language, doing exercises (either from the book or for example spotting the homework puzzles given on this site - but don't post your answer, we don't do other peoples homework!)

    If you get stuck, post here, and someone will help you out.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Registered User
    Join Date
    Jul 2008
    Posts
    9
    thank you, yes, I've talked with my parents about it, and i do know its a large commitement, but I am hoping to find a way that works best for me about learning this language. I tried when I was 11 years old to do visual basic, but at that age, it does make a difference because you havent had much schooling to use the knowledge you already know to relate to how the language works. Now i might have a way better chance, thank you for your post mat, and for the homework on the site suggestion

  6. #6
    3735928559
    Join Date
    Mar 2008
    Location
    RTP
    Posts
    838
    what are your interests?

    gaming?

    music?

    art?

    it might help to pick something that interests you and try to write a program related to that.

  7. #7
    Registered User
    Join Date
    Jul 2008
    Posts
    9
    My big interest is gaming definitly, and I really want to go into that in the future thank you also, that does make sense, and I will try to do that to help practice and perfect the knowledge I gain.

    Edit ~ also for some reason every time i try to type a code for a program into my compiler, it never works, but if i copy paste it from the tutorial it will, when the stuff I wrote looks exactly like the stuff on the tutorial, idk why...
    Last edited by ultrablade12; 07-30-2008 at 04:17 PM.

  8. #8
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Another good way to learn is to write some code [not HUGE amounts] and post it here for comments. Be aware that not everyone has the same opinion, but comments will probably be made [particularly if you ask] as to whether there is a different/better/recommended way of doing something. Remembering that for the next time [or implementing the ideas suggested] when you see good suggestions is the idea.

    In companies, you normally have something called "Code Review". In our company, we send out a listing of the bits of code that has changed [a "diff"], and tell the colleagues that have worked with the subject code before to have a look over it, and they will ask questions and/or point out mistakes made in the code. Again, the idea is that "more eyes see more things", so that the quality of the code is improved.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  9. #9
    Registered User
    Join Date
    Jul 2008
    Posts
    9
    lol, thanks mat I can only write the most simplest of things right now (like i mean so simple you'll think its garbage, and it doesnt even do anything. ) I guess thats what u get when you have someone who started to learn last night lol... I will keep that in mind when i can actually use the knowledge i get to make something worth looking at though. I appretiate everyone's reply, thank you still open for more comments if a reader thinks appropriate.

    Edit ~ Also random tips would be helpful if any skilled programmers would like to share any tips that may be helpful to a newbie like me, and maybe helpful to me later on in my adventures of programming
    Last edited by ultrablade12; 07-30-2008 at 04:47 PM.

  10. #10
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Quote Originally Posted by ultrablade12 View Post
    Edit ~ Also random tips would be helpful if any skilled programmers would like to share any tips that may be helpful to a newbie like me, and maybe helpful to me later on in my adventures of programming
    Learn what "undefined" and "undefined behavior" means. This will save you loads of grief.

  11. #11
    Registered User
    Join Date
    Jul 2008
    Posts
    9
    I guess that helps, now to find what they mean :P

  12. #12
    Registered User
    Join Date
    Oct 2006
    Posts
    118
    I started a couple of years ago when I was your age. Just keep going through random tutorials.

    And I'll tell you what REALLY helped me. Start working on something WAY over your head. I started using wxWidgets after learning just the basics (didn't even know classes, silly me!), and jumping into something so complex FORCED me to learn more than what I ever would have learned just doing random stuff.

    Most importantly, have a goal. Why are you learning C++? That's what you need to code for!

    Best of luck!
    FlyingIsFun1217

  13. #13
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Jumping into stuff too complicated is usually not a good idea. Perhaps you'll learn, but if you do, often it's the wrong way.
    It's better to really learn the basics first, then try building up complications as you can, and most important of all - SOLVE the problems the arises and not ignore them.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  14. #14
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I wrote a bit about undefined behaviour here:
    http://cpwiki.sourceforge.net/Undefined_behaviour

    You may also want to study some of the other subjects there.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  15. #15
    3735928559
    Join Date
    Mar 2008
    Location
    RTP
    Posts
    838
    Quote Originally Posted by ultrablade12 View Post
    My big interest is gaming definitly, and I really want to go into that in the future thank you also, that does make sense, and I will try to do that to help practice and perfect the knowledge I gain.

    Edit ~ also for some reason every time i try to type a code for a program into my compiler, it never works, but if i copy paste it from the tutorial it will, when the stuff I wrote looks exactly like the stuff on the tutorial, idk why...
    recreating dikumuds (the original MMORPG) seems to be a pretty popular choice.

    that's what i did o-so-long ago when i was first learning.

    they're 100% text based, so you can learn all about how different bits of code work together to create the mechanics of a game without having to delve into graphics programming just to get something done.

    there's quite a few threads in this forum that are in that vein. i'd do a search, and lots or reading, then post questions in the threads that seem at least half-way understandable to you, or if you're feeling plucky enough to go at it yourself, start your own thread and post up your own code.
    Last edited by m37h0d; 07-31-2008 at 08:57 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. validation problem in a loop (newbie question)
    By Aisthesis in forum C++ Programming
    Replies: 11
    Last Post: 05-10-2009, 10:47 PM
  2. Newbie in problem with looping
    By nrain in forum C Programming
    Replies: 6
    Last Post: 11-05-2005, 12:53 PM
  3. Help with Constants and enum constants. Newbie learning C++.
    By UnregJDiPerla in forum C++ Programming
    Replies: 5
    Last Post: 01-07-2003, 08:29 PM
  4. Replies: 4
    Last Post: 08-15-2002, 11:35 AM
  5. newbie coding problem
    By rippascal in forum C++ Programming
    Replies: 10
    Last Post: 01-08-2002, 11:45 PM