I'm new to programming in C.
I took most of this from a book and tryed to add my own code to see if I could get it to work. int y doesn't print 120 and I'm not too sure why. I don't want the answer I would like hits on what I did wrong.
#include <stdio.h> /* standard i/o include file*/
struct xampl {
int x;
int y;
};
int main()
{
struct xampl structure;
struct xampl *ptr;
struct xampl y;
structure.x = 12;
structure.y = 120;
ptr = &structure;
printf( "%d\n", ptr->x ); /* The -> acts somewhat like the * But it gets what is at that memory address*/
printf("%d\n", y);
getchar();
return 0;
}
…dude…. Thats fucking annoying, your being ignorant and unclear. Why dont you bury your computer in Egypt and try to shove a pyramid up your ass cuz thats about all your 'intellectual' mind will be able to comprehend. Nah jk haha. Just don't be so annoying, consider yourself mildly chastised/flamed.
Uber0n wrote: So you can't code in C but you don't want people to tell you exactly what's wrong with your code…? :right:
No, I can code in C but not a lot. I'm still learning and couldn't find my mistake. I have a book here that I am reading, I added some of my own code to that to have a better understaning of what it does and how it works. I asked for a hint because I don't like being spoon fed.