Handout 3

Table 1: Some C++ Characters

CHARACTER
EFFECT
\n

\a

\"

\t

Jumps to a new line

Makes an alert sound

Displays "

Shifts by a horizontal tab

Question: What is the output of each of the the following?

  • cout<<"\r";
  • cout<<"\\";


    In the following table we summarize the range and size of C++ basic data types. Notice that some people use unsigned for unsigned int, long for long int, and short for short int.

    The following is a table of some basic C++ data types:

    Table 2: Baisc C++ data types

    DATA TYPE RANGE SIZE
    short int

    unsigned short int

    long int

    unsigned long int

    int

    float

    double

    char

    bool

    long double

    -32,768 : 32,767

    0 : 65,535

    -2,147,483,648 : 2,147,483,647

    0 : 4,294,967,925

    -32,768 : 32,767

    1.2 e-38 : 3.4 e38

    2.2 e-308 : 1.8 e308

    256 characters (alphabets, digits (0..9), etc)

    true, false

    approximately e-4932 : e4932

    2 bytes

    2 bytes

    4 bytes

    4 bytes

    4 bytes

    4 bytes

    8 bytes

    1 byte

    1 byte

    8 bytes