-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
单链表问题 #1
Comments
指向结构体的指针
|
删除指针p:delete p和p = NULL的区别是什么?
|
在链表的中间位置插入:
结构体指针直接赋值有什么作用? |
https://github.com/ujsyehao/data-structure/issues#issuecomment-397139788
|
没有,只是声明了指针变量
指针指向的内存空间被释放,表示这一段内存空间已经被系统回收了,你的程序就没有权限使用这段内存了,但是指针变量p还是存储着原来那一段内存空间的地址,也就是p不为NULL。 |
Node *tmp只是声明,而int a就是定义了 |
Node *tmp;
tmp -> data = value;
tmp -> next = NULL;
defined in class
报错: segmentation fault
错误原因:结构体/结构体指针未分配内存就直接初始化
Node *tmp
在编译器中执行的是什么操作?有没有分配内存?有没有初始化?The text was updated successfully, but these errors were encountered: