Skip to content

Instantly share code, notes, and snippets.

@petrosagg
Created April 3, 2015 11:39
Show Gist options
  • Select an option

  • Save petrosagg/94d8ee88cfc21d0d3836 to your computer and use it in GitHub Desktop.

Select an option

Save petrosagg/94d8ee88cfc21d0d3836 to your computer and use it in GitHub Desktop.
wtf
#include <stdio.h>
#include <stdlib.h>
int main() {
int * buffer = (int *) malloc(10 * sizeof(int));
int i;
for (i = 0; i < 10; i++) {
buffer[i] = 0;
printf("%d\n", buffer[i]);
}
memfrob(buffer, 10 * sizeof(int));
for (i = 0; i < 10; i++) {
printf("%d\n", buffer[i]);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment