求助,结构体问题
struct A{};
struct B
{
....
strcut A..
....
}
结构体A在结构体B内,已知结构体A的地址,如何利用函数求得结构体B的地址?
struct A{};
struct B
{
....
strcut A..
....
}
结构体A在结构体B内,已知结构体A的地址,如何利用函数求得结构体B的地址?
我测试了一下,测试程序如下:
#include<stdio.h>
#include<conio.h>
struct node
{
int i;
int j;
};
int main()
{
struct node st;
clrscr();
printf("%x %x",&st,&st.i);
getch();
}
结果是:
ffd4 ffd4