信仰青春 2022-08-04 13:06 采纳率: 16.7%
浏览 68
已结题

运行不了,哪儿编译错了嘛?

#include<stdio.h>
struct student
{
    char name[50];
    int age;      
    int score;    
};

int main()
{
  struct  student  stu={"zhangsan",20,90};
  strcpy(stu.name,"lisi");
  stu.age=18;
  stu.score=100;
  printf("name=%s,age=%d,score=%d",stu.name,stu.age,stu.score);

    return 0;
}

  • 写回答

5条回答 默认 最新

  • 快乐鹦鹉 2022-08-04 13:24
    关注

    运行不了是怎么个现象呢???
    需要#include <string.h>吧

    评论 编辑记录

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 8月4日
  • 修改了问题 8月4日
  • 修改了问题 8月4日
  • 修改了问题 8月4日
  • 展开全部