Skip to content
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

软件:week11 问题反馈和讨论 #36

Open
ghostbody opened this issue Nov 30, 2015 · 10 comments
Open

软件:week11 问题反馈和讨论 #36

ghostbody opened this issue Nov 30, 2015 · 10 comments

Comments

@ghostbody
Copy link
Collaborator

Reserved...

@JerryChan31
Copy link

@ghostbody 方便把上星期SOJ的1005和1007移到YOJ上吗?还想再做一下

@ghostbody
Copy link
Collaborator Author

@Jerrychan31 不太方便,移植还是挺麻烦的,ta电脑也跪了。你可以自己按照题目做一下。

@chenhu297
Copy link

如何调用到自己写的string.h

@ghostbody
Copy link
Collaborator Author

@Neighborwan 自己为什么会写.h?

@Diabi
Copy link

Diabi commented Dec 15, 2015

师兄,对一个一级指针p二次解引用编译报错,这样的解释是否合理:因为p解引用后得到的是一个整形的值,此时再对它解引用是不合法的。@ghostbody

@ghostbody
Copy link
Collaborator Author

@Diabi 不恰当。一级指针解引用之后是int类型数据。再次解引用时候,应该把该数据看做指针(也就是内存地址),访问这个内存地址出错是因为非法的内存访问。

@Diabi
Copy link

Diabi commented Dec 15, 2015

好的,谢谢师兄。@ghostbody

@Diabi
Copy link

Diabi commented Dec 15, 2015

又碰到新的问题了师兄@ghostbody
int *p;
int *r = &p;
这个会造成编译错误,但我的理解是指针不是可以存储一个地址值吗,那为什么储存不了指针变量的地址呢?

@ghostbody
Copy link
Collaborator Author

@Diabi 这样写编译器不会报错,只会报出警告。另外,指针除了地址之外,还有一个特性就是类型,不同的指针类型也是不同的。

int * p 的类型是 int *
而 &p 的类型是 int **

@Diabi
Copy link

Diabi commented Dec 16, 2015

哦,了解了。麻烦师兄了。@ghostbody

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants