错误:C4430:缺少类型说明符-假定为int.注意:C++不支持default-int
error: C4430: missing type specifier - int assumed. Note: C++ does not support default-int
我在寡妇7中使用Qt创建者5.10。
我写了一个tcp套接字程序。
#include <QTcpSocket>
QTcpSocket *tcpClient;
tcpClient = new QTcpSocket(this);
错误:
1 missing type specifier - int assumed. Note: C++ does not support default-int
2 'tcpClient' : 'int' differs in levels of indirection from 'QTcpSocket *'
3 'this' : can only be referenced inside non-static member functions
如果tcpClient
是全局变量,正如这段代码所建议的那样,您不能在全局范围内的单独语句中初始化它。只有变量声明、命名空间声明和函数可以在全局范围内。
此外,this
只能在非静态类方法的实现体内部使用。
相关文章:
- 为什么在全局范围内使用"extern int a"似乎不行?
- int(c) 和 c-'0' 之间的区别。C++
- 从"int*"强制转换为"unsigned int"会丢失精度错误
- 为什么野牛仍在使用"int yylex(void)",却找不到"int yylex(YYS
- 有符号的int和int-有没有一种方法可以在C++中区分它们
- 请解释这句话(cout<<1+int((a<b)^((b-a)&1) )<<endl
- 是否可以从int转换为enum类类型
- 不能在初始值设定项列表中将非常量表达式从类型 'int' 缩小到'unsigned long long'
- 缺少类型说明符 - 假定为 int.注意 c++ 不支持 default-int
- 错误:C4430:缺少类型说明符-假定为int.注意:C++不支持default-int
- 错误C4430:丢失类型指定词 - 假设INT.注意:C 不支持对我的构造函数的默认设置
- CREATESTRUCT错误C4430:缺少类型说明符-假定为int.注意:C++不支持默认的int C:xdc
- 错误 1 错误 C4430:缺少类型说明符 - 假定为 int.注意:C++不支持默认整数
- 模板类:错误 C4430:缺少类型说明符 - 假定为 int.注意:C++不支持默认整数
- 错误 C4430、C2146 - 缺少类型说明符 - 假定为 int.注意:C++不支持默认整数
- srand(time(NULL)):错误 C4430:缺少类型说明符 - 假定为 int.注意:C++不支持默认整数
- 这是什么意思?:注意:参数 1 没有从"int"到"const 帐户"的已知转换
- VC++缺少类型说明符-假定为int.注意:C++不支持default-int
- C2143 缺少 '*' 之前的';' 和 C 4430 缺少类型说明符 - 假定为 int。注意 C++ 不支持 default-int
- 错误c4430缺少类型说明符-假定为int.注意:c++不支持default-int生成器