Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 26
  1. #11
    Join Date
    Jun 2009
    Posts
    27
    This website should be able to help you tremendously in understanding C++:

    http://www.cprogramming.com/tutorial...first-followup

    A couple other resources, books, which I find useful are:

    Beginning C++ Through Game Programming
    Sams Teach Yourself C++ in One Hour a Day

    I most absorb the instruction of the web resource I first linked to though, its explanations are very coherent and thorough. Funny side note: I find I learn best reading while lying in bed, where my mind is most relaxed and receptive. I usually read that web resource there on my phone.

    Quote Originally Posted by bakil View Post
    its hard to just learn someone c++ ive had c++ teached to me for over a year and a half and i still only know the basics and i get stuff pretty quickly with programming (i understand the concepts very fast) so my advice is to start with C just so you get the hang of variables functions loops if etc then move over to C++ since C++ is based on C
    if you start with c++ without proper guidance from a teacher (it being in real life or from the 3dbuzz videos here) you're going to get "lost" and burn out on learning it

    my 2 cents
    Starting with C is a generally a very recommended-against idea, and will only makes things more convoluted and difficult.
    Last edited by Delicieuxz; 08-17-2012 at 07:19 AM.

  2. #12
    Join Date
    Jan 2007
    Location
    Belgium, Antwerp
    Posts
    204
    Quote Originally Posted by Delicieuxz View Post
    Starting with C is a generally a very recommended-against idea, and will only makes things more convoluted and difficult.
    fair enough just said that cus thats what they did in my school this year (equivalent to university)
    Life is too short to worry about things

  3. #13
    Join Date
    Nov 2010
    Location
    Sweden
    Posts
    580
    Last edited by CodeJunkie; 08-18-2012 at 10:45 AM.

  4. #14
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    84
    I personally would NEVER start with C. That language is much too cryptic and a pain in the neck. C++ is more friendly.

  5. #15
    Join Date
    Jun 2009
    Posts
    27
    Quote Originally Posted by CodeJunkie View Post
    No books needed any more mate. Read my signature and it will all be good
    Another great youtube C++ series is the Absolute Noob Spoonfed series:

    http://www.youtube.com/user/antirtfm...e=results_main

  6. #16
    Join Date
    Feb 2005
    Location
    Bellevue, WA
    Posts
    3,251
    Quote Originally Posted by Saturn226 View Post
    I personally would NEVER start with C. That language is much too cryptic and a pain in the neck. C++ is more friendly.
    That's got to be the funniest thing I've read today!

    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." ~Rich Cook

  7. #17
    Join Date
    Mar 2012
    Posts
    112
    I would recommend studying up on keywords in C++. When I used to program, mastering these was what helped me get through classes. Int is the most common keyword, but there are many others like float and var. Knowing what they do, and how best to use them, is what will help make you better at programming.

    By the way, I have been told that you need to be good with math to be good with programming, but in my opinion this isn't the case. All you need to know is basic algebra, such as x = 2. This is the format you will use when assigning things to variables. Variables, as I'm sure you know already, are keywords such as int, that are designed to hold stuff in the program to be used later. = is the symbol used to assign data to those variables. So for example-

    int baseball = 1;

    In the above code line, I did some things. I created (or declared, as some programmers prefer to say) an int, gave it a name (you do this by typing what you want the int to be called immediately after declaring it) which is baseball, and assigned it a number (by using the = symbol to assign it the number 1) and ended the code line with the symbol ;. This is the way most of the code lines work in C++. So now I can use that int for something else, such as this -

    if (baseball = 1)
    {
    "endless loop"
    }

    In those code lines, I used an if loop to make a never ending loop. A loop is a part of program code that will continue to do something and not end until a condition is met. Since this particular loop has no condition to end, it will loop endlessly, repeating the "endless loop" string. By the way, a string is a line of text that can be read by the viewer.

    So, to conclude, here are some tips -

    1. Have a goal before programming. Ask yourself - what are you trying to program? Believe me, this helps A LOT, as going into the IDE with no goal on what to program will only get you lost.

    2. C++ is heavily reliant on keywords to perform. Therefore, study all the keywords available, what they do, and when best to use them. I recommend studying up on loops such as for, while, and do, and variables such as int, float, and double. Knowing these keywords and others will boost your skill with C++ leaps and bounds.

    3. Read other people's code, to see how they did things. And look for this symbol - //. The // symbol is called a comment tag, and is what programmers use to leave directions or reason on why they did what they did in the code. The handy thing with the // symbol, is that anything written after that symbol in a line of code will be skipped by the compiler. Meaning, it will not effect the program in any way. It is meant to be read by human eyes. So you will see something like this -

    int football = 1;
    int basketball = 3;
    // I assigned basketball the number 3 so that it could start higher then football

    obviously, the comment tags will be more in-depth, but hopefully you get the idea.

    4. Keep programming, and keep asking for help when you need it. C++ can be difficult, so you have my respect for attempting to learn it =)

  8. #18
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    84
    Quote Originally Posted by owensd View Post
    That's got to be the funniest thing I've read today!
    Just my personal preference. c had me in tears lol.

  9. #19
    Join Date
    Jun 2003
    Posts
    150
    C is not a hard language to learn, it just lets you make a lot of stupid mistakes for you to learn from, it's programming without the training wheels .

    Unfortunately the problem the OP has is the same problem anyone will have when they enter a new field of knowledge that has matured enough to have easily recognized day to day patterns compressed into singular cryptic words, also known as jargon. Take the original question, what the hell are .h files and how the hell do they work?

    A .h file is a header file. A header is something that appears at the top of any document, in other words, a letter head. It's the same thing that you can make in an MS Word document when you want something to appear at the top of multiple Word documents. It's the same design/layout/format you see on any piece of paper you get from the same source. All your bank statements have the same beginning look(name of the bank, the logo, address of the branch it's mailed from, etc.).

    Basically it's used so we don't have to retype the same crap every in every source file. The compiler will only compile code in a source file(.cpp file). There are times we need to include a lot of other things in that source file to make it work correctly. Here things get a bit more tricky, but not hard to understand when you see how things work in a sense(ironically a lot programming books/teachers/websites/videos ask you take a lot of stuff on faith which is completely stupid, probably because they were never taught how it works either and never bothered to learn or even think about how it could work on their own.../end another personal but highly related rant).

    Every function, structure, and class need to have two things, the interface that defines how it is to be used(name, what it returns, what parameters it asks), and the actual instructions in carries out when they are used(even just reading variable's value is technically a set of instructions). Every block of code with a name, function, structure/class method(they are different from normal functions), gets compiled once and is essentially put in a large table. Every place a function/method call is made the compiler replaces that location with instructions to jump to that functions' location in the table, saving its current location so it knows where to come back to once that function is done.

    Now what does this have to do with the header files? When we make a function call we only need to know about the interface, not what the function actually does. Header files are generally used to write down what are called prototypes, which is nothing more than the interface to the function. The compiler knows that the code for that function will be at some known location in that table, but it needs to know that the programmer is using it correctly, by making sure it is passing in the correct type and number of arguments and is going to catch the correct return type if it catches it at all. Normally if we would want to use that function before we've even written what it can do(or if that function is written in a separate source file), we would have to write the prototype for that function before we call it, in every .cpp file.

    Instead we make a header that includes all the prototypes/interface definitions we need and we tell the compiler to add those prototypes to the source file before we even compile. Hence why you use the #include keyword. In fact, every keyword that starts with # is called a pre-processor keyword, meaning "do these things before you even begin to compile the code in this file".

    Once you start stripping away the jargon and remove the idea that a computer is some mystical device you cannot understand, you'll realize that what makes a computer actually work is not that complex, and a lot of bizarre things you were to do on faith, make sense.

    Now that I've had my little rant about the evils of teaching with jargon and such, let me turn things around and say that jargon isn't some evil thing that is used to make others feel "superior" to others(though it gets heavily used in this manner). Since we have a limited life span we as individuals cannot learn all there is to know, we just don't have the time. So to further a knowledge pool we need to do two things, bring people up to speed and also communicate in a way that saves time, hence why we give proper names to everything. Describing something or someone each time you need to refer to them takes forever, it's much quicker just say single word or phrase so people are immediately put into the correct frame of mind. It seems blindingly obvious but we give grand names to even common sense things such as Occam's razor (http://en.wikipedia.org/wiki/Occam%27s_razor). If after finding out what it means the first phrase that comes to your mind is "No shit", you've probably identified something that should probably not be glorified with a title/jargon. The lesson, be careful when you create your own jargon, you should be able to explain it clearly and in detail before you start using it and getting others to use it.

  10. #20
    Join Date
    Feb 2005
    Location
    Bellevue, WA
    Posts
    3,251
    Quote Originally Posted by Saturn226 View Post
    Just my personal preference. c had me in tears lol.
    It's funny because C++ is essentially C with a TON of stuff added to it, that's all.

    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." ~Rich Cook

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •