#include <stdio.h>
int main(void) {
int x = 3;
int * ptr;
ptr = &x; //store address of x in pointer
*ptr = 8; // change the x by 8
printf("the value of x is : %d\n" , x
); printf("the value of x is : %d\n" , *ptr
); printf("the address of x is : %d\n",&x
); printf("the address of x is : %d\n" , ptr
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSB7CmludCB4ID0gMzsKIGludCAqIHB0cjsKIHB0ciA9ICZ4OyAvL3N0b3JlIGFkZHJlc3Mgb2YgeCBpbiBwb2ludGVyCiAqcHRyID0gODsgLy8gY2hhbmdlIHRoZSB4IGJ5IDgKIHByaW50ZigidGhlIHZhbHVlIG9mIHggaXMgOiAlZFxuIiAsIHgpOwogcHJpbnRmKCJ0aGUgdmFsdWUgb2YgeCBpcyA6ICVkXG4iICwgKnB0cik7CiBwcmludGYoInRoZSBhZGRyZXNzIG9mIHggaXMgOiAlZFxuIiwmeCk7CiBwcmludGYoInRoZSBhZGRyZXNzIG9mIHggaXMgOiAlZFxuIiAsIHB0cik7CiAKCXJldHVybiAwOwp9Cg==