| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 718 人关注过本帖
标题:非语法错误,错在哪里?
只看楼主 加入收藏
devfhpgah
Rank: 1
来 自:江西
等 级:新手上路
帖 子:204
专家分:0
注 册:2007-8-16
收藏
 问题点数:0 回复次数:2 
非语法错误,错在哪里?
#include <stdio.h>
#include <stdlib.h>
struct Information
{
    int num;
    char name[20];
    char sex;
    float score[3];
    float average;
}person[4];
void Input(struct Information *p,int n);
int main()
{
    Input(person,4);
}
void Input(struct Information *p,int n)   /*对结构体内的变量赋值*/
{
    int i;
    char temp[4];
    for(i=0;i<4;i++,p++)
    {
        printf("Input No.%d:",i+1);
        gets(temp);
        p->num=atoi(temp);
        printf("Input the name:");
        gets(p->name);
        printf("Input the sex:");
        p->sex=getchar();
        while(getchar()!='\n')
         continue;
        printf("Input three scores:");
        scanf("%f%f%f",p->score[0], p->score[1],p->score[2]);
    }
}
搜索更多相关主题的帖子: 语法 name include num Input 
2008-05-31 17:35
Loli
Rank: 1
来 自:飞燕算法群46520219
等 级:新手上路
帖 子:348
专家分:0
注 册:2008-5-27
收藏
得分:0 
scanf("%f%f%f",p->score[0], p->score[1],p->score[2]);

请问这是什么

" border="0" />[color=white]
2008-05-31 17:40
devfhpgah
Rank: 1
来 自:江西
等 级:新手上路
帖 子:204
专家分:0
注 册:2007-8-16
收藏
得分:0 
明白了,少了个&

努力才会成功!
2008-05-31 17:47
快速回复:非语法错误,错在哪里?
数据加载中...
 
   



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

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