char 与char* 字符串与字符
#include<iostream>
#include<sstream>
using namespace std;
int main()
{
int n;
char *months[12]= {
"January", "February", "March", "April", "May", "June", "July",
"August", "September", "October", "November", "December"
};
cout<<"输入月份:";
cin>>n;
cout<<months[n-1]<<endl;
return 1;
}
char a[] 是有n多个a变量。。 char*a[] 是N多个叫做a的指针。
里面每一个都是 字符串
char months[12]={'a','b','c'};
所以要char *
所以要char *