|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
#include<stdio.h>
#include<stdlib.h>
#include <string.h>
int count = 0;
struct SCHOOL
{
char school[32];
int class;
char studentname[16];
int age;
char sex[8];
int height;
int weight;
char introduction[256];
struct SCHOOL* next;
};
main()
{
struct SCHOOL* phead = NULL,*temp=NULL;
phead = (struct SCHOOL*)malloc(sizeof(struct SCHOOL));
temp = phead;
temp->school = "sichuan university";
temp->class = 1;
temp->studentname = "yangke";
temp->age = 18;
temp->sex = "boy";
temp->height = 160;
temp->weight = 80;
temp->introduction= "short";
}
代码中截取的一段,为什么类似temp->school这种字符串的无法录入,int型可正常录入。temp处提示表达式必须是可修改的左值。求大佬帮助,今晚必须要搞定,救救老弟,万分感谢
代码文件开头添加这样一句
- #define _CRT_SECURE_NO_WARNINGS
复制代码
|
|