sir,
plz send me the solution of this program.
Question
Create a program that declares an integer array with five elements. Now store in that integer array five different elements (10,20,30,40,50 ) using a pointer variable only.
Hints
The identifier of an array is equivalent to the address of its first element, as a pointer is equivalent to the address of the first element that it points to.
If A[5] is an array then the expressions A[2] and *(A+2) designate the same thing. Use (*A+2) to store the value in the third element of array.
plz send me the solution of this program.
Question
Create a program that declares an integer array with five elements. Now store in that integer array five different elements (10,20,30,40,50 ) using a pointer variable only.
Hints
The identifier of an array is equivalent to the address of its first element, as a pointer is equivalent to the address of the first element that it points to.
If A[5] is an array then the expressions A[2] and *(A+2) designate the same thing. Use (*A+2) to store the value in the third element of array.
Comment