//本文在c++builder10,3调试通过。
#include <vcl.h>
#include <windows.h>
#include <tchar.h>
#include <stdio.h>
int _tmain(int argc, _TCHAR* argv[])
{
char str[500]={0};
char *p=str;
String S="Happy Birthday";//14个字符
int num=S.Length()*2; //注意这里要*2
memcpy(str,S.c_str(),num);
std::cout<<str<<std::endl;//只打出了一个字符H
std::cout<<num<<std::endl;
for (int i = 0; i <num; i++)//这里要用循环才能打出所有
{
//std::cout<<p;
printf(p);
p++;
}
printf("\n");
system("pause");
return 0;
}