Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C, pointers, basic problem

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

Name: sage 2009-11-21 22:01

What a pile.

You forgot the # for the #include directive.  But it wouldn't compile if you actually did that so I will just assume that it was cut off when you copy+pasted.

1. Main needs to return int
2. Learn to indent your god damn code
3. Use code tags
4. Stop bumping a 3 ½ year old thread

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List