Name: Anonymous 2006-05-20 14:45
Here is my code, just learning more about pointers:
include<stdio.h>
main()
{
int x, *ptr_x;
int y, *ptr_y;
int z, *ptr_z;
x=64;
y=128;
z=256;
puts("This is a program used to display information on pointers:\n");
printf("x=%d and the pointer is %p\ny=%d and the pointer is %p\nz=%d and the pointer is %p\n",x,y,z,ptr_x,ptr_y,ptr_z);
return 0;
}
And the output:
This is a program used to display information on pointers:
x=64 and the pointer is 0x80
y=256 and the pointer is 0x8fe07604
z=0 and the pointer is 0x1
include<stdio.h>
main()
{
int x, *ptr_x;
int y, *ptr_y;
int z, *ptr_z;
x=64;
y=128;
z=256;
puts("This is a program used to display information on pointers:\n");
printf("x=%d and the pointer is %p\ny=%d and the pointer is %p\nz=%d and the pointer is %p\n",x,y,z,ptr_x,ptr_y,ptr_z);
return 0;
}
And the output:
This is a program used to display information on pointers:
x=64 and the pointer is 0x80
y=256 and the pointer is 0x8fe07604
z=0 and the pointer is 0x1