#include <iostream>
using namespace std;
int main() {
int * a[5];
char * b[5];
cout<<a[1]; // this works and prints address being held by second element in the array
cout<<b[1]; // this gives run time error . why ?
return 0;
}
Run Code Online (Sandbox Code Playgroud)
任何人都可以向我解释cout<<b[1]给出运行时错误?int和char数组的行为是否应该彼此相似?