结构体赋值在编译时提示语法错误从网上找来一个例子,测试创建一个学生信息结构体,但是在main中赋值时提示语法错我,我是第一次用结构体,不知道是哪儿出错了,哪位大侠有用过,请不吝赐教!多谢多谢!
单片机C语言代码如下:
#include "STC32G.h"
#include "stdio.h"
#include "stdarg.h"
#include "string.h"
#include "stdlib.h"
typedef struct
{
char Name[50];
unsigned int age;
float score;
}student;
void main(void)
{
student stu1 = //编译报语法错误
{"zhangsan",
20,
92.5
};
while(1)
}
|