64,639
社区成员
发帖
与我相关
我的任务
分享
// SwitchServer.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
class cc
{
public:
void rr()
{
strcpy (aa, "233");
}
void test (void *pp)
{
pp = aa;
}
protected:
private:
char aa[32];
};
int main(int argc,char* argv[])
{
char tedt[22] = "";
cc c;
c.rr();
c.test(tedt);
return 0;
}
#include <stdio.h>
#include <string.h>
class cc
{
public:
void rr()
{
strcpy (aa, "233");
}
void test (void *pp)
{
for (int i=0;i<strlen(aa);i++)
{
*((char *)pp+i)=aa[i];
}
}
protected:
private:
char aa[32];
};
int main(int argc,char* argv[])
{
char tedt[22]="";
cc c;
c.rr();
c.test(tedt);
printf("test=%s\n",tedt);
return 0;
}
void test (void *pp)
{
pp = aa;
}
int main(int argc,char* argv[])
{
char tedt[22] = "";
cc c;
c.rr();
c.test(tedt);
return 0;
}
void test (void *&pp)
{
pp = aa;
}