随笔分类 -  C/C++指针

指针如此重要,以至于不得不单成立一个分类
摘要:实验环境win7操作系统下vs2017 定义结构体用于存放教练信息 struct mycoach { char name[60]; int age; char skills[60]; }; 定义线性表存放教练信息 struct seqlist { struct mycoach* mch[10];// 阅读全文
posted @ 2019-12-24 17:03 saintdingtheGreat 阅读(434) 评论(0) 推荐(0)
摘要:引用的本质 一个常量指针 #include<iostream> using namespace std; void crzaychange(int &a, int &b) { int c; c = a; a = b; b = c; } void main() { int a = 100; int b 阅读全文
posted @ 2019-12-18 00:13 saintdingtheGreat 阅读(143) 评论(0) 推荐(0)
摘要:重要意义:间接赋值的意义,实现了模块的功能划分,实现了软件作品的分层,使得模块接口和信息系统得以实现。 所谓二级指针就是指向指针的指针,其声明形式如下 int *p=NULL int **p1=NULL; p1=&p; 一级指针*运算,从所指向内存空间取出数值(类比:一级指针是藏宝图,所指向的内存空 阅读全文
posted @ 2019-12-17 13:26 saintdingtheGreat 阅读(1368) 评论(0) 推荐(0)
摘要:char *其实就是char[length]的首元素地址 实验环境:centos7下qt5.11 中文char类型占3个字节 char[length]="特别车队"其实等价于char *mywords="特别车队" #include<stdio.h> #include<stdlib.h> #incl 阅读全文
posted @ 2019-12-16 12:54 saintdingtheGreat 阅读(214) 评论(0) 推荐(0)