![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
笔记
μ★
这个作者很懒,什么都没留下…
展开
-
c++ 交换指针所对应的地址与交换指针的值
void swap1(int *pa, int *pb){ int tem; tem = *pa; *pa = *pb; *pb = tem;}传指向int的指针,只能让子程序改变int的值而需要改变的是指针的时候,那么只能用指向指针的指针(复杂),或引用,或返回指针值 void swap1(int *&pa,int*&pb){ int *temp...原创 2020-04-13 16:12:16 · 3935 阅读 · 2 评论 -
new的用法
用c++写链栈,链队列时用new创造结点:struct node{Int data;stuct node*next;}在.h定义node*front;在.cpp中需要front=new node;因为刚开始只是定义了front指针,没有赋值,而new可以开辟一块空间并把地址返回,从而实现front的赋值。...原创 2020-03-13 16:34:22 · 1346 阅读 · 0 评论