結構體賦值在編譯時提示語法錯誤從網上找來一個例子,測試創建一個學生信息結構體,但是在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)
}
|