标题:warning C4013: 'malloc' undefined; assuming extern returning int
只看楼主
mm1746886443
Rank: 1
等 级:新手上路
帖 子:24
专家分:0
注 册:2019-11-2
结帖率:50%
 问题点数:0 回复次数:1 
warning C4013: 'malloc' undefined; assuming extern returning int
#include<stdio.h>
main()
{
    struct stu
    {
        int num;
        char*name;
        char sex;
        float score;
    }*ps;
    ps=(struct stu*)malloc(sizeof(struct stu));
    ps->num=102;
    ps->name="Zhang ping";
    ps->sex='M';
    ps->score=62.5;
    printf("Number=%d\nName=%s\n",ps->num,ps->name);
    printf("Sexr=%c\nScore=%f\n",ps->sex,ps->score);
    free(ps);
}
搜索更多相关主题的帖子: num warning int name malloc 
2019-12-12 22:09
mm1746886443
Rank: 1
等 级:新手上路
帖 子:24
专家分:0
注 册:2019-11-2
得分:0 
#include <malloc.h>少了头文件
2019-12-12 22:12



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-498360-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017107 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved