当前位置:网站首页>小鲁客栈---预告篇
小鲁客栈---预告篇
2022-07-29 05:07:00 【小鲁客栈】
介绍
准大四学生仔,目前深圳“人上人”,一个试图用最通俗易懂的例子讲解自己所理解知识的打工人。目前暂定的是半年时间的沉淀也就是说只连载半年的时间,主要记录并分享自己日常沉淀的知识,目前包含C/C++、QT、嵌入式软件GUI设计思想。可能有人会问为什么是半年,因为目前的实习时间是半年,然后如果中间因为各种原因被辞退了那可能也会终止连载。。。
目的
一方面呢是因为有一个自己的个人博客比较好找工作毕竟算是一个加分项;另一方面就是自己确实是有在沉淀一些东西,有真正的静下心来去研究一些东西,或许在一些技术大牛眼里不算什么。。。但是我认为的真正的学会不是自己理解,而是可以给别人讲明白,所以有了现在的博客连载。
试讲
现在呢是一个c语言的*a和&a的一个典型问题的讲解,下面的讲解风格就是后面的连载博客里的风格。如果下面的风格接受不了后面的博客就没必要看了。。。
对于C语言的*和&可能很多人都知道 *a表示一个指针;&a表示a的地址;那这个时候可以动手运行一下,下面的代码:int a=10;int *b=&a;printf("&d\n",&a);printf("&d\n",*b)
看完输出结果后,足够了解的可能没有什么感觉,但是没有足够了解的可能就陷入疑惑了,两个的结果为什么并不相同。
首先我们要明白变量的a的本质,他是一个存储单元,存储单元他既是本身去作为一个容器去存储某些东西也有着独属于自己的标识,这里的某些东西被称为数据,标识被称为地址。也就是说a既可以是一个地址也可以是一个数据,那么访问的时候怎么确定访问得到的结果是什么?这里就涉及到了C语言的规定,在C语言中规定a表示数据、&a表示地址。
那么接下来再看 * a,这里表示的是存储的a中的存储的地址对应的存储单元的数据,大致意思就是说:我给警察举报通缉犯的现在居住地址是某某公寓805房,这里我举报给警察地点就相当于 * a,我告诉了警察地址,但是警察要抓的是地址的房子吗?并不是,要抓的是地址里的人。
然后我们在看上面的代码段, * b=&a,这里拿到的是a的地址,最后输出 * b时要输出的是a的内容而不是a的地址,就像是警察抓人,要抓的是人而不是地址所代表的房子。所以最终的printf(“&d\n”,&a)输出的是一个a地址,而printf(“&d\n”,*b);输出的是a的内容。
最后
如果感觉上面的试讲有听懂并且感兴趣的话也想要,希望可以动动小手点个关注,后续出了博客也可以多多关注,感谢。
边栏推荐
- MySQL many to many relationship, grouping and splicing to query multiple data to one data
- Big silent event Google browser has no title
- Word如何查看文档修改痕迹?Word查看文档修改痕迹的方法
- ARFoundation从零开始5-AR图像跟踪
- The representation of time series analysis: is the era of learning coming?
- Modification of annotation based three-tier project and the way of adding package scanning
- scikit-learn——机器学习应用开发的步骤和理解
- Mysql语句中的函数
- SM integration is as simple as before, and the steps are clear (detailed)
- Force deduction ----- sort odd and even subscripts respectively
猜你喜欢

Solution | get the relevant information about the current employees' highest salary in each department |

开源汇智创未来 | 2022开放原子全球开源峰会 openEuler 分论坛圆满召开

The person who goes to and from work on time and never wants to work overtime has been promoted in front of me

Northeast University Data Science Foundation (matlab) - Notes

How to solve the problem of configuring the progress every time Office2010 is opened?

The song of the virtual idol was originally generated in this way!

虚拟偶像的歌声原来是这样生成的!

pytorch学习笔记
![[file download] easyexcel quick start](/img/fd/b3b08c67c5a81f0ab58c20653f9398.png)
[file download] easyexcel quick start

电脑无法打开excel表格怎么办?excel打不开的解决方法
随机推荐
How to solve the problem of configuring the progress every time Office2010 is opened?
Understand activity workflow
三层项目的架构分析及构造方法的参数名称注入
SM integration is as simple as before, and the steps are clear (detailed)
Unity metaverse (III), protobuf & socket realize multi person online
关于thymeleaf的配置与使用
Five correlation analysis, one of the most important skills of data analysts
Diagram of odoo development tutorial
7.3-function-templates
一文带你搞懂环绕通知@Around与最终通知@After的实现
[file download] easyexcel quick start
ARFoundation入门教程7-url动态加载图像跟踪库
The representation of time series analysis: is the era of learning coming?
sql日志
Force deduction ----- sort odd and even subscripts respectively
基于注解的三层项目的改造及添加包扫描的方式
开源汇智创未来 | 2022开放原子全球开源峰会 openEuler 分论坛圆满召开
[untitled]
VirtualBox has expanded the capacity of virtual hard disk (without modifying the original data)
What servers are needed to build mobile app