#include <iostream> using namespace std;
#include <conio.h>
void main() { char *c_point[10];
for (int i = 0; i < 10; i++) { c_point[i] = new char[10]; //没有这句是错误的,没有分配内存,最好的方案是用string cin >> c_point[i]; }
for (int j = 0; j < 10; j++) { cout << *(c_point + j) << endl; }
getch(); }
#include <iostream> using namespace std;
#include <conio.h>
void main() { //char *c_point[10]; string c_point[10];
for (int i = 0; i < 10; i++) { // c_point[i] = new char[10]; //没有这句是错误的,没有分配内存 cin >> c_point[i]; }
for (int j = 0; j < 10; j++) { cout << *(c_point + j) << endl; }
getch(); }
|