解决VS2015安装后stdio.h ucrtd.lib等文件无法识别问题,即include+lib环境变量配置:
https://blog.csdn.net/carl_qi/article/details/51171280
例子:
#include "stdio.h"//预处理指令 int main() { int a, b, c, sum; int add(int x, int y);//函数需要声明 //scanf("%d,%d", &a, &b);scanf输入不会检查边界 //scanf_s("%d,%d", &a, &b);很多带“_s”后缀的函数是为了让原版函数更安全 //&为取地址 //长度最长为4,3,表示缓存区大小;相当于处理了异常 scanf_s("%d,%d", &a, &b); scanf_s("%d,%d", &c, 2); sum = add(a, b); printf(" a is %d \n b is %d \n sum is %d\n c is %d", a, b, sum, c);//%d表示输出十进制 } int add(int x, int y) { return x + y; }
原文:https://www.cnblogs.com/-beauTiFul/p/8981641.html