当前位置:网站首页>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中的示例版本较老,很多写法已经过时了,不建议大家学习,示例只是参考该函数是如何使用的即可。
边栏推荐
- View UI Plus 发布 1.2.0 版本,新增 Image、Skeleton、Typography组件
- Dark chain lock (lca+ difference on tree)
- Abstract classes and interfaces
- Relational algebra of tyut Taiyuan University of technology 2022 database
- Record: solution of 404 error of servlet accessing database in dynamic web project
- MPLS experiment
- Small exercise of library management system
- 国企秋招经验总结
- TYUT太原理工大学往年数据库简述题
- 初识指针笔记
猜你喜欢

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

Small exercise of library management system

Conceptual model design of the 2022 database of tyut Taiyuan University of Technology

学编程的八大电脑操作,总有一款你不会

Edit distance (multi-source BFS)

Fgui project packaging and Publishing & importing unity & the way to display the UI

最新坦克大战2022-全程开发笔记-1

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

Cloud native trend in 2022

凡人修仙学指针-1
随机推荐
六种集合的遍历方式总结(List Set Map Queue Deque Stack)
Fundamentals of UD decomposition of KF UD decomposition [1]
System design learning (III) design Amazon's sales rank by category feature
CorelDRAW plug-in -- GMS plug-in development -- Introduction to VBA -- GMS plug-in installation -- Security -- macro Manager -- CDR plug-in (I)
十分钟彻底掌握缓存击穿、缓存穿透、缓存雪崩
vector
【话题终结者】
KF UD decomposition pseudo code implementation advanced [2]
Inheritance and polymorphism (I)
Alibaba cloud microservices (III) sentinel open source flow control fuse degradation component
121道分布式面试题和答案
Error: symbol not found
系统设计学习(一)Design Pastebin.com (or Bit.ly)
Shortest Hamilton path (pressure DP)
Iterable、Collection、List 的常见方法签名以及含义
最新坦克大战2022-全程开发笔记-1
(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
[Topic terminator]
Implement queue with stack
Tyut Taiyuan University of technology 2022 "Mao Gai" must be recited