Wednesday, July 9, 2014

Static v/s Const variables.

Static variable keep their values and are not destroyed even after they go out of scope.

Eg:
          int ReturnNumber()
          {
               Static int n_id = 0;
               return n_id++;
          }
          int main()
          {
                std::cout<<ReturnNumber();
                std::cout<<ReturnNumber();
                std::cout<<ReturnNumber();
               
                return 0;
          }

Output:    0 1 2.

Const:
         The const keyword specifies that variable's value is constant and tells the compiler to prevent the programmer from modifying it.

 Eg:        const int n = 5;
               n++;          // Error
               n=6;          // Error.
 ----

String Table

A string table is a Windows resource that contains a list of IDs, values, and captions for all the strings of your application. For exa...