4. Introduction to c++: Variable and data types summary: Basic Programming for Beginners :: Videos


This is the third video in the series of videos for basic programming skill in C++.

This video basically introduces what are the variables and variable identifiers in C++, how are they used and why are they important and also how to use them to make a program more useful.

Key terms:

  • Variable: Portion of memory to store and determine a certain value. 
  • Valid identifier: sequence of letters, numbers and underscore, and cannot start with number. Can start with underscore(_) but not recommended.
  • Reserved keywords: That are there already for compiler to use and we declaring them will just try to initialize again causing error.
  • List of reserved keywords:
    asm, auto, bool, break, case, catch, char, class, const, 
    const_cast, continue, default, delete, do, double, 
    dynamic_cast, else, enum, explicit, export, extern, 
    false, float, for, friend, goto, if, inline, int, long, 
    mutable, namespace, new, operator, private, protected, 
    public, register, reinterpret_cast, return, short, 
    signed, sizeof, static, static_cast, struct, switch, 
    template, this, throw, true, try, typedef, typeid, 
    typename, union, unsigned, using, virtual, void, 
    volatile, wchar_t, while 
  • Operator words that may be reserved:
    and, and_eq, bitand, bitor, compl, not, not_eq, or, 
    or_eq, xor, xor_eq
  • List of fundamental data type:
Type size Range
char 1 byte signed: -128 to 127
unsigned: 0 to 255
short int
2 bytes signed: -32768 to 32767
unsigned: 0 to 65535
int 4 bytes signed: -2147483648 to 2147483647
unsigned: 0 to 4294967295
long int
4 bytes signed: -2147483648 to 2147483647
unsigned: 0 to 4294967295
bool 1 byte true or false
float 4 bytes +/- 3.4e +/- 38 (~7 digits)
double 8 bytes +/- 1.7e +/- 308 (~15 digits)
long double 8 bytes +/- 1.7e +/- 308 (~15 digits)
wchar_t 2/4 bytes 1 wide character


  • Variables can be initialized basically in two ways:
    • int a = 10; or
    • int a (10);
  • string variable types can store bunch of characters.



Please login to post your thoughts!

There are no commnets yet!


Don't have an account?
Register here

Subscribe Youtube

Network DigitalStage.org

Some interesting stuffs