1.char[]转char*
#include<iostream>
#include<string.h>
using namespace std;
int main(){
//char[] 转 char*
char ch[]="abcdefghijklmn";
char *s = ch;
cout<<s<<endl;
return 0;
}
2.char*转
char[]
#include<iostream>
#include<string.h>
using namespace std;
int main(){
//char* 转 char[]
char *s="abcdefghijklmn";
char ch[100];
strcpy(ch,s);
cout<<ch<<endl;
return 0;
}