码迷,mamicode.com
首页 > 其他好文 > 详细

VS控制台应用

时间:2018-05-02 19:16:10      阅读:182      评论:0      收藏:0      [点我收藏+]

标签:crt   实现   .net   后缀   family   href   ext   https   .lib   

  • 源(c)文件:主要是源码,包括程序入口,函数的实现
  • 头(h)文件:主要是定义的函数声明
  • 资源(rc)文件:程序中用到的辅助资源,比如位图,图标资源

 

解决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;
}

 

 

 

  

 

VS控制台应用

标签:crt   实现   .net   后缀   family   href   ext   https   .lib   

原文地址:https://www.cnblogs.com/-beauTiFul/p/8981641.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!