Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试这段代码:
int main() { char *ch="hello"; printf("%u",&ch); return 0; }
从上面的printf()陈述中,我得到了 ch 的地址65524 我的问题是,如果给出的任何地址都像*(65524)而不是一样,我能找到价值*(&ch)吗?
printf()
65524
*(65524)
*(&ch)
是的你可以:
printf("%d\n", *(unsigned char *) 65524);
如果地址未指向有效对象,则您调用的是未定义的行为。