pointer problem

here is my program. Basically i want to ask the user for a value. then his selected value will replace the value inside the array,the user will have to specify what element of the array by typing the address of the element of the array. can anybody help me here? thx


#include <cstdlib>
#include <iostream>
#include <stdio.h>

using namespace std;
int main()
{

int intarr[4] = {0,1,2,3 };
int i;
int *point;
point=intarr;

for(i=0; i<4; i++)
{
printf("element %d value = %d \n", i, *point);
point++;
cout<<point<<endl;

}


int adress;
int *ptr;
int z
printf("please type in the address of the value you want to change");
scanf("%X", &adress);

ptr = (int*)adress;

printf("The Value of %X is %d", &adress, *ptr);

printf("The new value of the interger will be X\n");
scanf("%d", &z)

system("PAUSE");
return EXIT_SUCCESS;
}
Are you sure you want the user to provide the memory address and not the array index? How is the user to know what the address is?
Well I agree with PanGalactic that there is a terminology problem in the question. However, what do you want help with exactly? State whether this is C or C++. I do not know why you are including both iostream and stdio.h.
Topic archived. No new replies allowed.