注册 登录
编程论坛 C++教室

刚刚学到数据结构,写的一段代码通不过。。。

a9580643 发布于 2016-05-27 17:33, 3750 次点击
#include <iostream>
struct super
{
    char name[20];
    float b;
    double c;
}
int main()
{
    using namespace std;
    super hong =
    {
       "ahong",
        55.5,
        44.4
    };
    super san =
    {
        "asan",
        11.1,
        22.2
    };
    cout<<"hong:"<<hong.name<<"$";
    cout<<hong.c<<endl;
    san=hong;
    cout<<"a san:"<<san.name<<"$";
    cout<<san.c<<endl;
    system ("pause");
    return 0;
}
1 回复
#2
a95806432016-05-27 17:41
struct super
{
    char name[20];
    float b;
    double c;
}此处未打分号。。。以解决
1