首页 编程C/C++演示typedef创建别名

演示typedef创建别名

#include <iostream>
//Demonstrates typedef keyword
using std::cout;
using std::endl;
typedef unsigned short USHORT;  //typedef defined
int main()
{
 USHORT Width = 5,Length;
 Length = 10;
 USHORT Area = (Width * Length);
 cout << “Width:” << Width << endl;
 cout << “Length:” << Length <<endl;
 cout << “Area:” << Area << endl;
 return 0;
}