首页 > 解决方案 > 为什么我可以在 C 中调用未定义的函数 sqrt()?

问题描述

嘿伙计们,我想知道为什么我的程序只是返回垃圾,我发现我没有包含 math.h。但是,如果函数没有任何定义,为什么代码还要编译和运行呢?

#include <stdio.h>

int main()
{
    int ka = 0;

    ka = sqrt(4);

    printf("ha ist %d", ka);

    system("PAUSE");
    return 0;
}

标签: c

解决方案


推荐阅读