作业有问题,大家帮帮我吧
我的问题提示为:||=== 作业, Debug ===|\main.c|19|error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token|||=== Build finished: 1 errors, 0 warnings ===|
代码为:#include <stdio.h>
#include <stdlib.h>
struct _date
{
int year;
int month;
int day;
}Date;
typedef struct _person
{
int phone_number;
char name[10];
char sex;
char adress[50];
struct _date birthday;
}Person;
void main
{
int i,j;
FILE *fp;
fp=open("mytest.txt","wt");
for(i=0;i<=50;i++)
{
fprintf (fp,"%d,%d\n",sizeof (struct _date),sizeof (Person));
}
fclose(fp);
}
拜托大家了,谢谢
[解决办法]
main 后面少个()
应该是fopen.
[解决办法]
++
[解决办法]
注意main函数的标准写法啊 ,书上都是错的
int main(void)
{
}
int main(int argc,char* argv[])
{
}