![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C
文章平均质量分 63
一打雪碧
这个作者很懒,什么都没留下…
展开
-
const、常量指针、指向常量的指针
有点迷迷糊糊的,不过好在,绕出来了前提首先要知道,定义了一个 int 类型的数据之后,它的地址的类型为 int* 类型。定义了一个 const int 类型的数据,它的地址的类型是 const int* 类型。指向常量的指针什么叫指向常量的指针?我们往往会定义const 来修饰的数据,比如:const int n = 9; // 定义了一个整型常量 n如果想使用一个指针来指向它,应该是什么类型的指针呢?首先说,下面的指针是不可以的const int n = 9; // 定义了一个整型常量原创 2022-03-09 11:13:33 · 907 阅读 · 0 评论 -
结构体类型的字节数
结构体的字节数sizeof()运算符用于计算基本类型、结构体类型的所占字节数;#include <iostream>using namespace std;struct student{ int id; char ch;};int main(){ printf("%d\n",sizeof(int)); printf("%d\n",sizeof(char)); printf("%d",sizeof(student)); retur原创 2021-01-06 19:28:45 · 2685 阅读 · 0 评论