嗨,我正在尝试定义一个名为 USHORT 的别名。
// Demonstrates typedef keyword
#include <iostream>
typedef unsigned short int USHORT; // typedef defined
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;
}
我不断收到编译器错误说:
错误 1 错误 C4430:缺少类型说明符 - 假定为 int。注意:C++ 不支持 default-int c:\users\naqvi-home\documents\justit\c++\w1\cp1\list0304.cpp 8 1 ConsoleApplication3
谢谢