Skip to content

Instantly share code, notes, and snippets.

@surinoel
Created July 16, 2019 08:35
Show Gist options
  • Save surinoel/35f77f7c161db351e8e0d6b3c2ef91fa to your computer and use it in GitHub Desktop.
Save surinoel/35f77f7c161db351e8e0d6b3c2ef91fa to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(void) {
int i = 100;
double d = 3.14;
void* p = &i;
*(int*)p = 200;
printf("%d\n", i);
p = &d;
*(double*)p = 4.14;
printf("%lf\n", d);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment