| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 526 人关注过本帖
标题:c语言相关问题,我写个程序如下,可是系统说错误是:C:\Program Files\Micr ...
只看楼主 加入收藏
理你妹的叶秦
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2015-5-13
收藏
 问题点数:0 回复次数:2 
c语言相关问题,我写个程序如下,可是系统说错误是:C:\Program Files\Microsoft Visual Studio\MyProjects\11\
#include <iostream>
using namespace std;
struct Date
{int month;
int day;
int year;
};
struct Student
{int num;
char name [20];
char sex;
Date birthday;
float score;
}student 1,student 2={10002,"wang li",'f',5,23,1992,89.5};
int main( )
{student1=student2;
cout<<student1.num<<endl;
cout<<student1.name<<endl;
cout<<student1.sex<<endl;
cout<<student1.birthday.month<<'/'<<student.birthday.day<<'/'<<student1.birthdayyear<<endl;
cout<<student1.score<<endl;
return 0;
}

搜索更多相关主题的帖子: Microsoft include c语言 
2015-05-13 15:56
wp231957
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:神界
等 级:贵宾
威 望:423
帖 子:13688
专家分:53332
注 册:2012-10-18
收藏
得分:0 
看不懂你这东东  一会student 1 一会student1  搞不懂你要干嘛

DO IT YOURSELF !
2015-05-13 16:18
hoy0a1d
Rank: 2
等 级:论坛游民
帖 子:19
专家分:83
注 册:2010-8-1
收藏
得分:0 
太乱了  帮你整了下  顺便改了下错误
程序代码:
#include <iostream>
using namespace std;

struct Date
{
    int month;
    int day;
    int year;
};

struct Student
{
    int num;
    char name [20];
    char sex;
    Date birthday;
    float score;
}student1, student2 = {10002, "wang li", 'f', 5, 23, 1992, 89.5};

int main()
{
    student1 = student2;
    cout << student1.num << endl;
    cout << student1.name << endl;
    cout << student1.sex << endl;
    cout << student1.birthday.month << '/' << student1.birthday.day << '/' << student1.birthday.year << endl;
    cout << student1.score << endl;
    return 0;
}


 

Test.
2015-05-13 17:48
快速回复:c语言相关问题,我写个程序如下,可是系统说错误是:C:\Program Files ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.028947 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved