Created
September 25, 2019 05:03
-
-
Save jafffy/a393de668ea1d320cc79993a06a67a21 to your computer and use it in GitHub Desktop.
How to interpret pointer variable?
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> | |
int main() | |
{ | |
float f = 3.141592f; | |
printf("%f\n", f); | |
int i = f; | |
printf("%d\n", i); | |
int* p = (int*)&f; | |
printf("%p %p %d\n", &f, p, *p); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment