J
Jack
For the small code below:
#include <iostream>
using namespace std;
int main()
{
char a1[128] = "string 1";
char a2[128] = "string 2";
char a3[128] = "string 3";
char ** p;
p[0] = a1;
p[1] = a2;
p[3] = a3;
cout << "p: "<<*p<<" p1: "<<*(p+1)<<" p2: "<<*(p+2)<< " p3: " << *(p
+3) << endl;
}
The output is:
p: string 1 p1: string 2 p2:
Why p[3] can not be printed out?
Thanks.
#include <iostream>
using namespace std;
int main()
{
char a1[128] = "string 1";
char a2[128] = "string 2";
char a3[128] = "string 3";
char ** p;
p[0] = a1;
p[1] = a2;
p[3] = a3;
cout << "p: "<<*p<<" p1: "<<*(p+1)<<" p2: "<<*(p+2)<< " p3: " << *(p
+3) << endl;
}
The output is:
p: string 1 p1: string 2 p2:
Why p[3] can not be printed out?
Thanks.