|
发表于 2020-5-10 14:30:01
|
显示全部楼层
#include <iostream>
using namespace std;
void fun(unsigned char *in,unsigned char *out,int *outlength)
//or yin yong
{
strcat((char *)out,(char *)in);
strcat((char *)out," but add a tail!!");
*outlength=strlen((char *)out);
}
void main()
{
char _in[1024];
char _out[1024];
int len=0;
memset(_in,0,sizeof(_in));
memset(_out,0,sizeof(_out));
strcpy(_in,"thi is in buf!!");
fun((unsigned char *)_in,(unsigned char *)_out,&len);
cout<<_in<<endl;
cout<<_out<<endl;
cout<<len<<endl;
system("pause");
}
你这个函数定义是传不出长度的! |
|