当前位置:网站首页>5.MSDN的下载和使用
5.MSDN的下载和使用
2022-07-06 09:20:00 【是王久久阿】
很多同学在初学C语言时,面对C语言中如此多的关键字、操作符、库函数感到非常头大。
利用MSDN这个工具可以帮助我们快速了解它们。
目录
MSDN的下载
完整版的MSDN非常大,很多功能是初学者用不到的。
这里给大家在百度云上提供精简版的MSDN,链接永久有效,供大家下载使用。
百度云链接:MSDN (精简版 大小:74.87.zip_免费高速下载|百度网盘-分享无限制 (baidu.com)
下载完成后,将压缩包解压,双击exe安装即可。
MSDN的使用
MSDN安装好后,双击运行即可。
索引
运行MSDN,进入到MSDN的界面中。
点击界面左侧的“索引”。(注意:是索引,不是搜索!!!)如果找不到索引,点击右侧的小箭头移动菜单栏即可。
函数介绍
点击索引后,在下方空白处输入我们想要查询的内容。例如:strlen
在屏幕上有strlen以及另外三个与之相关的函数,这里只需要看strlen的信息即可。
大标题下方的“Get the length of a string.”是对strlen的解释,了解到strlen是用来求字符串长度的。
函数结构
再往下,即是对strlen的使用结构进行说明。
size_t:表示为strlen的返回值是无符号整型。
const char* string:无法通过指针对string进行更改,但是可以通过变量名对string进行更改。
char* const string:无法通过变量名对string进行更改,但是可以通过指针对string进行更改。
这里对size_t以及const char* string不了解没有关系,把他们都去掉,只看strlen(strlen);即可。
头文件
在结构介绍下面,就是调用strlen函数所需要包含的头文件。
通过表格发现,如果调用strlen函数,需要包含头文件<string.h>。Compatibility为兼容性,不用过多了解,我们目前使用的电脑都是兼容的。
返回值介绍
Libraries部分的内容为:程序在运行时所需要的库文件,通常以LIB或DLL形式提供,这部分不用过多关注。
再下方便是返回值的介绍:
通过介绍了解到:strlen返回字符串中的字符数,但是不包括终端 NULL(不返回‘\0’)。当报错时,不返回任何值。
示例
滑动滚轮往下拉,MSDN还给我们举例示范了strlen怎么用。
将上述代码拷贝下来,粘贴至我们的VS中,测试一下是否和output所展示的一致。
#include <conio.h>
#include <dos.h>
这两行头文件其实没用,可以删掉,并且刚刚在头文件包含那里也没有显示。
#include <string.h>
#include <stdio.h>
void main(void)
{
char buffer[61] = "How long am I?";
int len;
len = strlen(buffer);
printf("'%s' is %d characters long\n", buffer, len);
}
对比一下,我们可以发现输出的内容是一致的。
当然,MSDN中的示例版本较老,很多写法已经过时了,不建议大家学习,示例只是参考该函数是如何使用的即可。
边栏推荐
- Interview Essentials: talk about the various implementations of distributed locks!
- 架构师怎样绘制系统架构蓝图?
- 最新坦克大战2022-全程开发笔记-2
- 最新坦克大战2022-全程开发笔记-3
- (super detailed II) detailed visualization of onenet data, how to plot with intercepted data flow
- arduino+水位传感器+led显示+蜂鸣器报警
- Share a website to improve your Aesthetics
- 系统设计学习(一)Design Pastebin.com (or Bit.ly)
- E-R graph to relational model of the 2022 database of tyut Taiyuan University of Technology
- Heap sort [handwritten small root heap]
猜你喜欢
西安电子科技大学22学年上学期《射频电路基础》试题及答案
121道分布式面试题和答案
arduino+水位传感器+led显示+蜂鸣器报警
系统设计学习(三)Design Amazon‘s sales rank by category feature
MySQL Database Constraints
There is always one of the eight computer operations that you can't learn programming
2年经验总结,告诉你如何做好项目管理
(super detailed II) detailed visualization of onenet data, how to plot with intercepted data flow
How do architects draw system architecture blueprints?
IPv6 experiment
随机推荐
TYUT太原理工大学2022数据库题库选择题总结
阿里云微服务(二) 分布式服务配置中心以及Nacos的使用场景及实现介绍
2022 National Games RE1 baby_ tree
[Topic terminator]
Role movement in the first person perspective
(ultra detailed onenet TCP protocol access) arduino+esp8266-01s access to the Internet of things platform, upload real-time data collection /tcp transparent transmission (and how to obtain and write L
13 power map
View UI Plus 发布 1.1.0 版本,支持 SSR、支持 Nuxt、增加 TS 声明文件
Tyut Taiyuan University of technology 2022 introduction to software engineering examination question outline
阿里云一面:并发场景下的底层细节 - 伪共享问题
MYSQL索引钟B-TREE ,B+TREE ,HASH索引之间的区别和应用场景
Exception: ioexception:stream closed
Inheritance and polymorphism (I)
Smart classroom solution and mobile teaching concept description
Sharing ideas of on-chip transplantation based on rtklib source code
View UI Plus 发布 1.3.1 版本,增强 TypeScript 使用体验
TYUT太原理工大学2022数据库考试题型大纲
面试必备:聊聊分布式锁的多种实现!
Ten minutes to thoroughly master cache breakdown, cache penetration, cache avalanche
How do architects draw system architecture blueprints?