learning

This is a discussion on learning within the C++ Programming forums, part of the General Programming Boards category; Yesterday I started really setting down and learning C++. I actually learned allot and still remember it. I'm using Beginning ...

  1. #1
    ___
    Join Date
    Jun 2003
    Posts
    806

    learning

    Yesterday I started really setting down and learning C++. I actually learned allot and still remember it. I'm using
    Beginning Visual C++ 6 by Ivor Horton. (www.wrox.com) I went through 2 chapters last night in the matter of hours.

    The first chapter was about the IDE and explained pretty much what c++ was. It explained how to use VC++ and all. The second was all about different variables and how to calculate and get input and post output with cin and cout and what the functions ment.

    Basically I'm wondering if its normal to get through that so fast or should I go back through and pretty much memorize everything( I know it and all but sometimes I need a reference back to it). Or am I ok with knowing it to a large extent and move onto the next chapter which would be loops.

    It's not like I just scanned through the first 2 chapters. I have 10 different programs based on that. Only 3 of which where from the book and the other 7 I did by myself using what I learned.

    Just looking for everyones opinion on this.


    Edit- Here is a direct link to the book. it gives an overview about the book and all. http://www.wrox.com/books/0764543881.shtml
    "When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."

  2. #2
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    Everyone learns at different rates. If you have previous experience programming, then learning basic stuff like I/O and arithmitic in C++ is a piece of cake. Just program, program, program. Try to incorporate what you learn into your programs to ensure that you have a firm grasp on it.
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

  3. #3
    ___
    Join Date
    Jun 2003
    Posts
    806
    I had tried learning Liberty Basic (a varation of basic language. Which I used beginning programming for dummies to use) and I got up to arrays then I decided that I would just move onto C.
    "When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."

  4. #4
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    Very good move. OSs are coded in C. BASIC is mere child's play.
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

  5. #5
    ___
    Join Date
    Jun 2003
    Posts
    806
    For some reason I couldn't grasp the concept of basic. I seem to understand the jargon of C++ better than I did of basic. I guess since C++ uses mostly things you never use i just remember them better than I did with basic since it uses too many words I use allot.
    "When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."

  6. #6
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    Thumbs up

    I don't have Horton's book, but two chapters in an evening is a fast pace for any technical book! I don't know if his book as questions/exercises at the end of each chapter... I prefer books that do, so I can tell if I'm really learning the stuff. You wrote 7 programs based on the first 2 chapters, so clearly you're ready for chapter 3 !

    In general, tutorial-style books re-use and build-upon previous chapters as you advance through the book. You'll know when you're moving too fast when you have to go back and re-study something.

    Do NOT try to memorize everything (unless you have a photographic memory). There is a LOT to C++ ! The more you practice, the less you'll have to look-up, but all programmers use reference books.

  7. #7
    ___
    Join Date
    Jun 2003
    Posts
    806
    Each chapter has a end of the chapter review and also a "test" where it tells you to write something with so so and so. Here are the things It tells you to do.

    Chapter 1

    1-List as many different ways to build a project as you can
    ------------------------------------------------------------------------------------
    2- List 3 types of files used to store information about a project and describe the role of each
    ------------------------------------------------------------------------------------
    3-Describe the use of the following files produced by the VC++ compiler. .obj .pch .pdb .exe
    ---------------------------------------------------------------------------------
    4- Edit the trialrun program to introduce various errors-miss out or put wrong curly braces, misspell names such as main and iostream. Build the project and use the help system to look at the errors.

    ***Note that was in a common error section******
    ------------------------------------------------------------------------------------
    5- Read about the IDE in the MSDN library.


    Chapter 2

    1-write a program which asks the user to enter a number and then prints it out, using an intefer as a local variable. We'll build on this example in chapters to come.
    ------------------------------------------------------------------------------------
    2- Write a program which inpute a variable of type int, and uses one of the bitwise operators ( i.e not the % operator!) to determine the positve remainder when divided by 8. for example, 29 = (3x8)+5 and -14 = (-2x8)+2 have positive remainder 5 and 2 respectfully.
    -----------------------------------------------------------------------------------
    3-fully parenthisize the following expressions in orfer to show the precedence and associativity

    1 + 2 + 3 + 4

    16 * 4 / 2 * 3

    a > b? a: c > d? e: f

    a & b && c & d

    ****I didn't understand this one too much. Any help here?***
    ----------------------------------------------------------------------------------

    4- Suppose we try to calculate the aspect ratio of our computer screen given the width and hight in pixels.

    Code:
    int width = 640;
    int hight = 480;
    
    double aspect = width / height;
    What answer will we get? Is is satisfactory - and if not how could you modify the code without adding anymore variables?
    -----------------------------------------------------------------------------------

    5- Without running it can ou work out what the following code is going to print and why?

    [code]
    unsigned s = 555;

    int i = ( s >> 4) & ~(~0 << 3);

    cout << i;


    *******Had trouble with that*************************




    Thats pretty much a straight copy from the book. (Mods am I breaking any rules posting that?)

    Beginning Visual C++ 6 by Ivor Horton (just to be safe )



    I thought it was pretty good and reviewed everything. What do you think and can I get some help with chapters 2 #3 and #5?
    "When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."

  8. #8
    Perverted unanimous's Avatar
    Join Date
    Oct 2001
    Posts
    336
    I'm with ZakkWylde969, I could never understand any BASIC languages no matter how much I tried, but as soon as I started languages like Java, C, and C++, I got them right away.
    Give me a bad reputation!!!

  9. #9
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    Thumbs down Bitwise operators in chapter 2...

    Ha! I was wondering if this was the book that introduced binary / bitwise operators in chapter 2! There was some discussion about this before.

    Don't get too bogged-down with this stuff. You can do lots of programming without it. You can learn it later at your own pace.

    There is some good info on bitwise operations in the
    Programming FAQ .

    FYI - Binary and hex are mostly used by people who work with hardware (like me), or by programmers writing hardware drivers.
    That 555 in his example should probably be 0x555 (Hex), because 5 converts to 101 binary, and 555 hex converts to 0101 0101 0101.

    FYI (2) - Windows' built-in calculator can to binary-to-decimal, and binary-to-hex conversion. Programs/Accessories/Calculator - View/Scientific.

    As far as the parenthesis/precedence question: I don't know the answer off-hand... But I think he's saying to add parenthesis to make the result the same as without them. This will make it easier for humans to understand what the statements are doing.
    Last edited by DougDbug; 07-11-2003 at 05:09 PM.

  10. #10
    ___
    Join Date
    Jun 2003
    Posts
    806
    Originally posted by unanimous
    I'm with ZakkWylde969, I could never understand any BASIC languages no matter how much I tried, but as soon as I started languages like Java, C, and C++, I got them right away.
    The basic functions where just too well..basic. That whole nomainwin really got me.
    "When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Machine Learning with Lego Mindstorms
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 01-30-2009, 02:34 PM
  2. Best Approach for Learning
    By UCnLA in forum C Programming
    Replies: 5
    Last Post: 03-21-2008, 03:35 AM
  3. Need Help On a Simple Bank Program
    By oobootsy1 in forum C# Programming
    Replies: 9
    Last Post: 08-08-2005, 11:51 AM
  4. Fun Learning a New Language
    By UnregdRegd in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 09-30-2003, 11:03 PM
  5. Learning Rate Of C++
    By Krak in forum C++ Programming
    Replies: 27
    Last Post: 01-29-2003, 01:53 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21