Mega Code Archive

 
Categories / C++ Tutorial / Data Types
 

Use typedef to define new type for unsigned short

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