定义一个结构体:
struct stude
{
char name[25];
int node;
}stu[110],max;
错误:
max.name=stu[0].name ;
正确:
strcpy(max.name,stu[0].name) ;
strcpy (字符数组1,字符串2)//将字符串2的字符,拷贝到字符数组1,返回字符数组1的首地址;
使用 strcpy 要加头文件 string.h ;
微信扫一扫
定义一个结构体:
struct stude
{
char name[25];
int node;
}stu[110],max;
错误:
max.name=stu[0].name ;
正确:
strcpy(max.name,stu[0].name) ;
strcpy (字符数组1,字符串2)//将字符串2的字符,拷贝到字符数组1,返回字符数组1的首地址;
使用 strcpy 要加头文件 string.h ;
相关推荐