Mega Code Archive

 
Categories / C++ Tutorial / Development
 

Use typedef keyword to define new variable type

#include <iostream>    typedef unsigned short int USHORT;           int main()  {     USHORT Width = 5;     USHORT Length;     Length = 10;     USHORT Area = Width * Length;     std::cout << "Width: " << Width << "\n";     std::cout << "Length: " << Length << std::endl;     std::cout << "Area: " << Area << std::endl;     return 0;  } Width: 5 Length: 10 Area: 50