struct PortSettings myComsetting //错误skip identifier 'Portsettings'
{
BAUD9600,DATA_8,PAR_NONE,STOP_1,FLOW_OFF,500//expected a declaration
};
c++结构体定义问题,求大神指点菜鸟
答案:2 悬赏:40 手机版
解决时间 2021-03-15 14:13
- 提问者网友:风月客
- 2021-03-14 19:12
最佳答案
- 五星知识达人网友:酒安江南
- 2021-03-14 20:24
typedef struct PortSettings
{
BAUD9600,DATA_8,PAR_NONE,STOP_1,FLOW_OFF,500//expected a declaration
}myComsetting;
{
BAUD9600,DATA_8,PAR_NONE,STOP_1,FLOW_OFF,500//expected a declaration
}myComsetting;
全部回答
- 1楼网友:傲气稳了全场
- 2021-03-14 20:59
看看这个例子:
#include <iostream>
using namespace std;
struct student{
int num;
char name[20];
};
int main()
{
student s,*p;
cin>>s.num>>s.name;
cout<<"num="<<s.num<<",name="<<s.name<<endl;
p=new(student);
cin>>p->num>>p->name;
cout<<"num="<<p->num<<",name="<<p->name<<endl;
delete p;
return 0;
}
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯