#include <stdio.h>struct A
{
int a;
};struct B
{
int b;
};struct C
{
struct A* a1;
struct B* b1;
}struct A* a2()
{
struct A* a3;
int a = 3;
a3->a = 3;
return a3;
}struct B* b2()
{
struct B* b3;
int b = 4;
b3->b = 4;
return b3;
}void main()
{
struct C *c;
struct A* a4;
struct B* b4;
a4 = a2();
b4 = b2();
c->a1 = a4;
c->b1 = b4;
printf("%d%d\n",c->a1->a,c->b1->b);
printf("%d",a4->a);
}
{
int a;
};struct B
{
int b;
};struct C
{
struct A* a1;
struct B* b1;
}struct A* a2()
{
struct A* a3;
int a = 3;
a3->a = 3;
return a3;
}struct B* b2()
{
struct B* b3;
int b = 4;
b3->b = 4;
return b3;
}void main()
{
struct C *c;
struct A* a4;
struct B* b4;
a4 = a2();
b4 = b2();
c->a1 = a4;
c->b1 = b4;
printf("%d%d\n",c->a1->a,c->b1->b);
printf("%d",a4->a);
}
解决方案 »
- 对话框上有个背景图片,图片中有些按钮形状,怎样捕获用户是否点击某个按钮?
- win32 打开 文件夹 对话框
- 如何将charl类型的转化为cstring类型的
- 错误,看不懂,帮忙看看
- 系统重启
- 请教一个简单的问题
- 急,重载CRichEditCtrl的mousemove函数后,为何鼠标不能从右到左选择文字?
- editor控件中,如何能在鼠标点击后知道点击在哪一行?
- 最大化和最小化问题
- 如何使用VC中还有的ActiveLock.ocx这一个控件?如果有demo就多加一百分。
- 调用 AfxGetApp()->HideApplication() ;后,怎么样恢复?
- COLOR_BTNHIGHLIGHT是什么颜色?
{
struct A* a3;
int a = 3;
a3->a = 3; //这里a3是野指针
return a3;
} struct B* b2()
{
struct B* b3;
int b = 4;
b3->b = 4; //这里b3是野指针
return b3;
}
{
int a;
}; struct B
{
int b;
}; struct C
{
struct A* a1;
struct B* b1;
} struct A* a2()
{
struct A* a3 = (struct A*)malloc(sizeof(struct A)); //分配内存
int a = 3;
a3->a = 3;
return a3;
} struct B* b2()
{
struct B* b3 = (struct B*)malloc(sizeof(struct B)); //分配内存
int b = 4;
b3->b = 4;
return b3;
} void main()
{
struct C *c = (struct C*)malloc(sizeof(struct C)); //分配内存
struct A* a4;
struct B* b4;
a4 = a2();
b4 = b2();
c->a1 = a4;
c->b1 = b4;
printf("%d%d\n",c->a1->a,c->b1->b);
printf("%d",a4->a); //释放内存
delete a4;
delete b4;
delete c;
}
#include <stdlib.h> struct A
{
int a;
}; struct B
{
int b;
}; struct C
{
struct A* a1;
struct B* b1;
} ;struct A* a2()
{
struct A* a3 = (struct A*)malloc(sizeof(struct A)); //分配内存
int a = 3;
a3->a = 3;
return a3;
} struct B* b2()
{
struct B* b3 = (struct B*)malloc(sizeof(struct B)); //分配内存
int b = 4;
b3->b = 4;
return b3;
} void main()
{
struct C *c = (struct C*)malloc(sizeof(struct C)); //分配内存
struct A* a4;
struct B* b4;
a4 = a2();
b4 = b2();
c->a1 = a4;
c->b1 = b4;
printf("%d%d\n",c->a1->a,c->b1->b);
printf("%d",a4->a); //释放内存
delete a4;
delete b4;
delete c;
}
#include <stdlib.h> struct A
{
int a;
}; struct B
{
int b;
}; struct C
{
struct A a1;
struct B b1;
} ;void a2(struct A* a3)
{
int a = 3;
a3->a = 3; } void b2(struct B* b3)
{
int b = 4;
b3->b = 4; } void main()
{
struct C c;a2(&c.a1);
b2(&c.b1); printf("%d%d\n",c.a1.a,c.b1.b); }