Answers1


1) Size of integer dependant on compiler / architecture / OS ?
   Ans: The sizes of the predefined integer types depend on the compiler. The
       decision of the compiler's author is likely to be guided by the
       characteristics of the machine.

2) What is the size of W_Char ? 
      Ans: 4 bytes.

3)How std::string class is implemented?
   Ans:  Reference.

4)Why to use wide strings and how?
  Ans: To support the Asian languages Symbols/chars we need to use the unicode .

      The unicode is implemented by wide strings
     wchar_t wch = 'a'; // 2 bytes, 0x0031
      wchar_t wsz = L"Hello"; // 12 bytes, 6 wide characters
     cout<<wch<<endl;
      cout<<wsz<<endl;
5)What is the scope of compiler optimization for volatile?
  Ans:For volatile variables compiler optimization is ignored.
          The memory resident for volatile variables is the physical  memory.