POINTERS ..C HELP - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

POINTERS ..C HELP

leemarkpoleemarkpo Posts: 2Member
This is what I made but I cant make it do what I want
"Use pointer dereferencing on pointers to y and z to change the value of
variables y = 10, z = x."

How can i make z=x? ugh it just post the adress


#include
#include

int main(int argc, char *argv[])
{

int x, y, z;
int *p1, *p2, *p3;

p1= &x;
p2= &y;
p3= &z;

*p1= *p3;
*p2= 10;
*p3= x;

printf("
y is equal to %d
",y);
printf("
z is equal to %d
",x);

system("pause");
return 0;
}
Sign In or Register to comment.