当前位置:网站首页>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中的示例版本较老,很多写法已经过时了,不建议大家学习,示例只是参考该函数是如何使用的即可。
边栏推荐
- Questions and answers of "signal and system" in the first semester of the 22nd academic year of Xi'an University of Electronic Science and technology
- Several high-frequency JVM interview questions
- Atomic and nonatomic
- Database operation of tyut Taiyuan University of technology 2022 database
- Voir ui plus version 1.3.1 pour améliorer l'expérience Typescript
- XV Function definition and call
- 8.C语言——位操作符与位移操作符
- Arduino+ water level sensor +led display + buzzer alarm
- Interview Essentials: talk about the various implementations of distributed locks!
- 初识指针笔记
猜你喜欢

西安电子科技大学22学年上学期《射频电路基础》试题及答案

What are the advantages of using SQL in Excel VBA

抽象类和接口

Experience summary of autumn recruitment of state-owned enterprises

MySQL 30000 word essence summary + 100 interview questions, hanging the interviewer is more than enough (Collection Series

Several high-frequency JVM interview questions

(超详细二)onenet数据可视化详解,如何用截取数据流绘图

TYUT太原理工大学2022数据库之关系代数小题

Alibaba cloud microservices (I) service registry Nacos, rest template and feign client

Application architecture of large live broadcast platform
随机推荐
ROS machine voice
MySQL backup -- common errors in xtrabackup backup
Alibaba cloud side: underlying details in concurrent scenarios - pseudo sharing
CorelDRAW plug-in -- GMS plug-in development -- Introduction to VBA -- GMS plug-in installation -- Security -- macro Manager -- CDR plug-in (I)
面渣逆袭:Redis连环五十二问,三万字+八十图详解。
Alibaba cloud microservices (III) sentinel open source flow control fuse degradation component
Record: I accidentally wrote a recursion next time
如何保障 MySQL 和 Redis 的数据一致性?
系统设计学习(一)Design Pastebin.com (or Bit.ly)
string
十分钟彻底掌握缓存击穿、缓存穿透、缓存雪崩
Set container
Relational algebra of tyut Taiyuan University of technology 2022 database
Application architecture of large live broadcast platform
View UI plus released version 1.3.0, adding space and $imagepreview components
View UI plus released version 1.3.1 to enhance the experience of typescript
最新坦克大战2022-全程开发笔记-3
vector
Record: newinstance() obsolete replacement method
阿里云微服务(三)Sentinel开源流控熔断降级组件