请帮我看一看啊
#include<stdio.h>struct time{
float arriveTime;
float runTime;
float totalTime;
char name[];
};
void InputTime(struct time *ps)
{ps->name[]='aaaaaaa';//这条语句显示错信息:Expression syntax in function inputTime
ps->runtime=10;
printf("%s\n",ps->name);
getch();
scanf("%",&ps->runTime);
getch();
};
main(){
struct time a[6];
stuct time *ps;
void InputTime(struct time *ps);
InputTime(a);
};
请指点啊
----------------解决方案--------------------------------------------------------
错误太多
LZ先调调
----------------解决方案--------------------------------------------------------
其实,我不知LZ这程序是表达什么意思的。。。。。
#include<stdio.h>
#include <stdlib.h>
#include<string.h>
struct time{
float arriveTime;
float runTime;
float totalTime;
//char name[];
char name[10];
};
void InputTime(struct time *ps)
//{ps->name[]='aaaaaaa';//这条语句显示错信息:Expression syntax in function inputTime
{strcpy(ps->name,"aaaaaaa");
//ps->runtime=10;
ps->runTime=10;
printf("%s\n",ps->name);
//getch();
scanf("%",&ps->runTime);
//getch();
};
main(){
struct time a[6];
struct time *ps;
void InputTime(struct time *ps);
InputTime(a);
};
----------------解决方案--------------------------------------------------------
谢谢
----------------解决方案--------------------------------------------------------