返回信息流最初是一个用C写的程序,规定了一个struct
struct update_info{
char action; // "1" is update request
char domainname[CRY_NAME];
char password[CRY_KEY];
int length;
char* mac;
char* ipaddress;
};
发送的时候强制转化为char*类型发送
目前遇到的问题是:
现在我用C++把这个struct改写成了类,
class UpdateInfo
{
public:
char action; // "1" is update request
char domainname[CRY_NAME];
char password[CRY_KEY];
int length;
char *mac;
char *ipaddress;
UpdateInfo();
~UpdateInfo();
};
发送的时候,用strcat把class中的内容拼起来可以吗?
存在数据对齐之类的问题吗?
这是一条镜像帖。来源:北邮人论坛 / cpp / #38706同步于 2010/4/29
该镜像源已超过 30 天没有更新,可能在源站已被删除。
CPP机器人发帖
问一下关于struct和class的问题
lixinyu2268
2010/4/29镜像同步2 回复
订阅后,新回复会通过你的通知中心匿名送达。