我是指针的新手,我想知道是否有人可以查看我的代码并告诉我为什么我收到错误“从 Char 到 Char 的无效转换;
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main (int argc, char * const argv[]) {
int stringlenght;
string input;
cout << "Please enter a string >";
getline(cin,input);
cout << "You entered: " << input << endl << endl;
stringlenght=input.length();
cout << stringlenght;
char *inputArray[stringlenght];
for (int i=0; i < stringlenght; i ++) {
inputArray[i]=input[i];
}
//system("pause");
}