Created
March 22, 2017 09:07
-
-
Save gshrikant/c3a28df5a7f9b3bac71e11cdbb8ffff3 to your computer and use it in GitHub Desktop.
Structure Pointers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* structs-3.c | |
* Use struct pointers without declaring the struct itself! | |
*/ | |
#include <stdio.h> | |
int | |
main(void) | |
{ | |
struct made_up_struct* something; | |
something = (struct made_up_struct*) &something; | |
printf("This compiles!\n"); | |
printf("Proof: address of pointer to struct on stack: %p\n", | |
(void*) something); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment