Skip to content

Instantly share code, notes, and snippets.

@iKlsR
Created August 14, 2012 02:36
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 iKlsR/3345863 to your computer and use it in GitHub Desktop.
Save iKlsR/3345863 to your computer and use it in GitHub Desktop.
errrrr
#include "iostream"
#include <stdlib.h>
#include <stdio.h>
using namespace std;
int main(int argc, char const *argv[])
{
long long unsigned int * ptr = new long long unsigned int; /* modern */
*ptr = 120;
cout << * ptr << endl;
delete(ptr);
unsigned int * x = (unsigned int *)malloc(sizeof(unsigned int)); /* old */
*x = 121;
fprintf(stdout, "%d\n", *x);
free(x);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment