哪位大神能帮我注释一下那个智能指针实现的地方有点不懂,我没有分了,剩最后5分都给了,谢谢

16:30 提问
这段编程出现了这个问题,哪位大神能帮我详细解答一下,谢谢啦
问题:0x 处有未经处理的异常: 0xC0000005: 读取位置 0x 时发生访问冲突
int main()
void swap(int *,int *);
int *p1=NULL,*p2=NULL;
swap(p1,p2);
cout&&*p1&&"
void swap(int *p11,int *p22)
int a=3,b=4;
按赞数排序
void swap(int *,int *);
你把函数声明放到main()函数上面。
#include "stdafx.h"
int main(int argc, char* argv[])
printf("Hello World!\n");
void swap(int ,int *);
int *p1=NULL,*p2=NULL;
p1 = (int)malloc(sizeof(int));
p2 = (int*)malloc(sizeof(int));
swap(p1,p2);
cout&&*p1&&" "&&*p2&&
void swap(int *p11,int *p22)
int a=3,b=4;
其他相关推荐

我要回帖

更多关于 智能指针原理 的文章

 

随机推荐