int main(int argc, char** argv)
{
double x = any_name_function();
return 0;
}
[smstong@centos192 test]$ gcc -c main.c [smstong@centos192 test]$ gcc main.o main.o: In function `main': main.c:(.text+0x15): undefined reference to `any_name_function' collect2: ld 返回 1
int any_name_function();
int main(int argc, char** argv)
{
double x = any_name_function();
return 0;
}
#include <stdio.h>
int main(int argc, char** argv)
{
double x = sqrt(1);
printf("%lf", x);
return 0;
}
[smstong@centos192 test]$ gcc -c main.c main.c: 在函数‘main'中: main.c:6: 警告:隐式声明与内建函数‘sqrt'不兼容 [smstong@centos192 test]$ gcc main.o
1.000000
2884223.000000
#include <stdio.h>
int main(int argc, char** argv)
{
int x = abs(-1);
printf("%d", x);
return 0;
}
#include <stdio.h>
int main(int argc, char** argv)
{
int x = abs(-1,2,3,4);
printf("%d", x);
return 0;
}
[smstong@centos192 test]$ gcc -c main.c [smstong@centos192 test]$ gcc main.o
gcc -std=c99编译 [smstong@centos192 test]$ gcc -c main.c -std=c99 main.c: 在函数‘main'中: main.c:5: 警告:隐式声明函数‘abs'
[smstong@centos192 test]$ g++ main.c main.c: In function ‘int main(int, char**)': main.c:5: 错误:‘abs'在此作用域中尚未声明
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有