Recycle Bin




Welcome to my blog! Here I plan to post information on things I'm studying and working on.

[1] [2]

C++ In One Hour A Day Lesson 3

Below are the review questions and my answers for lesson 3 of C++ In One Hour A Day.

  1. What is the difference between a signed and an unsigned integer?
    • Signed integers can contain negative numbers. An unsigned integer of the same size can contain 100% more numbers but no negatives.
  2. Why should you not use #define to declare a constant?
    • #define is an outdated method for declaring constants which replaces text with a value.
  3. Why would you initialize a variable?
    • Initializing variables ensures their values aren't random.
  4. What is the value of QUEEN from this line of code?: enum YOURCARDS{ACE,JACK,QUEEN,KING};
    • 2
  5. What is wrong with this variable name?: int Integer = 0;
    • Nothing. It compiles without error.

[1] [2]