Skip to content

Instantly share code, notes, and snippets.

@jafffy
Created September 25, 2019 05:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jafffy/a393de668ea1d320cc79993a06a67a21 to your computer and use it in GitHub Desktop.
Save jafffy/a393de668ea1d320cc79993a06a67a21 to your computer and use it in GitHub Desktop.
How to interpret pointer variable?
#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