Created
April 23, 2011 10:29
-
-
Save LadaF/938529 to your computer and use it in GitHub Desktop.
C Hello world with pointers
This file contains 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
# include <stdio.h> | |
char* ch; | |
struct typ{ | |
int i,j; | |
float a,b; | |
}; | |
struct typ t; | |
int main(void) | |
{ | |
t.i=*(int *) &"Hell"; | |
t.j=*(int *) &"o Wo"; | |
t.a=*(float *) &"rld!"; | |
t.b=*(float *) &"\n\0 "; | |
ch=(char *)&t.i; | |
printf("%s",ch); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment