[ create a new paste ] login | about

Link: http://codepad.org/88pmxnFA    [ raw code | output | fork ]

C, pasted on Jul 18:
1
2
3
4
5
6
7
8
9
10
11
12
#include <stdio.h>
//#include <stdlib.h>
int main() {
	int *p = (int*)malloc(sizeof(int));
	int *q = (int*)realloc(p, sizeof(int));
	*p = 1;
	*q = 2;
	if (p == q) {
		printf("%d %d\n", *p, *q);
	}
	return 0;
}


Output:
1
2 2


Create a new paste based on this one


Comments: