Home > Back-end > There was a little Pointers and arrays of problems
There was a little Pointers and arrays of problems
Time:10-01
A two-dimensional array [3] [3] A pointer initialized to & amp; A [0] [0] How can I make it point to a [2] [1] Using pointer operations #include using namespace std;
Int main () { Int x [3], [3]=,2,3,4,5,6,7,8,9 {1}; Int * p=& amp; X [0] [0]; Cout & lt; <* * ((int) (& amp; P + 2) + 1);
system("pause"); }
Error 1 error C4700: using an uninitialized local variable "p"
CodePudding user response:
#include using namespace std;
Int main () { Int x [3], [3]={1, 2, 3, 4, 5, 6, 7, 8, 9}; Int * p=(int *) (& amp; X [0] + 2) + 1; Cout & lt; <* p;
system("pause"); } Why did the can
CodePudding user response:
The problem is not you asked? Said no see rightly or wrongly, under xe7 can be compiled through, #include using namespace std;
Int main () { Int x [3], [3]=,2,3,4,5,6,7,8,9 {1}; Int * p=& amp; X [0] [0]; Cout & lt; <* * ((int) (& amp; P + 2) + 1);