[ create a new paste ] login | about

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

C, pasted on Jun 20:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
int main()
{
	int a = 5;
	/*
	int *b = &a;
	free(b); // Lỗi do đụng vào vùng nhớ Stack
	*/

	int *b = (int *)malloc(sizeof(int));

	*b = a;
	free(b);

	getch();
	return 0;
}


Output:
1
Line 17: error: conio.h: No such file or directory


Create a new paste based on this one


Comments: