Skip to content

Instantly share code, notes, and snippets.

@whoo
Created July 1, 2016 19:10
Show Gist options
  • Save whoo/ce56621e8baef5cdb638ce5f0cc6d7bd to your computer and use it in GitHub Desktop.
Save whoo/ce56621e8baef5cdb638ce5f0cc6d7bd to your computer and use it in GitHub Desktop.
Transforme void into int | fun with pointer
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
void *a;
a=malloc(sizeof(int)*1);
*((int *)a)=25;
printf("%d",*(int*)a);
free(a);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment