64,682
社区成员
发帖
与我相关
我的任务
分享
#include<iostream>
using namespace std;
struct A{
int a;
char b;
};
void main()
{
A *t;
t=(A*)malloc(sizeof(A));
t->a=2;
t->b='a';
void buf;
buf=(A*)malloc(sizeof(A));
memcpy(buf,t,2);
cout<<buf;
}