#include <iostream> #include <string> using namespace std; void reverse1(char * to,const char* from); void main(){ const char *str1="nicksam"; char *str2=new char(); strcpy(str2,str1); cout <<str2<<endl; char *str3=new char(); reverse1(str3,str1); cout <<str3<<" len:"<<strlen(str3)<<endl; } void reverse1(char * to,const char* from){ int n = strlen(from); for(int i=0;i<n;i++) to[i]=from[n-1-i]; //to[n]='\0'; }