A problem from my friend, what‘s the result of the following code:
class str{
public:
int x;
char s[0];
};
class foo{
public:
str * p;
};
int main() {
foo f = {0};
str* p1 = NULL;
if (f.p->s){
printf("%d\n", f.p->s);
}
return 0;
} foo f = {0};
C++ 指针的偏移 The offset of a pointer in C++,布布扣,bubuko.com
C++ 指针的偏移 The offset of a pointer in C++
原文:http://blog.csdn.net/taoqick/article/details/22760129