gpt4 book ai didi

C++ 编译器错误 c4430 "c++ doesnt support default int"

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:08:38 26 4
gpt4 key购买 nike

<分区>

您好,我正在尝试定义一个名为 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;
}

我不断收到编译器错误提示:

Error 1 error C4430: missing type specifier - int assumed. Note: C++does not supportdefault-int c:\users\naqvi-home\documents\justit\c++\w1\cp1\list0304.cpp 8 1 ConsoleApplication3

谢谢

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com