I have a question that I correctly type in the initial integer indicator Which of the following is the legal code? Or are both correct? Is it possible? All in C ++ if pointing to pointers vs pointing arrays They are not always consistent, they are hidden in the submission code because the array immediately changes into an indicator. Here array2 contains an array type and can not be used to store an indicator. Actually, the array is not assigned at all This can not be done because it is not L-vine. The array has a definite address and it will be like trying to write it again: [Hopefully, trying to reassign the location of a variable is a clear nonsense.] int * p and a right By the initial integer array
int * array1 = new int []
p = array1;
array1 = p;
p [0] Because, in my pointer arithmetic knowledge, it does not add anything.
int * array1 = new int [5]; // Legal, hep allocated array starting array with array array array2 [5] = {0}; // declare array directly on array and initalising with zero * int * p = 0; // declare indicator and start numm p = array2; // Legal, Pointer P = array1 specifying array; // specify the pointer for legal, pointer array1 = p; // Specify the pointer to the legal, pointer array2 = p; // ILLEGAL, specifying pointer for array
int array3 [5] = {0}; // declare the array directly on the stack and the array with the strings array3 = array2; // Unknown, array does not have L-value
int I = 0; & Amp; I = p;
Comments
Post a Comment