[ create a new paste ] login | about

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

C, pasted on Jun 20:
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void Nhap(int &x)
{
	printf("\Nhap vao gia tri: ");
	scanf("%d", &x);
}

void Nhap_1(int *x)
{
	printf("\nNhap vao gia tri: ");
	scanf("%d", x);
}

void Nhap_2(int **x)
{
	*x = (int *)malloc(sizeof(int));
	printf("\nNhap vao gia tri: ");
	scanf("%d", *x);
}
int main()
{
	int x;

	//Nhap(x);
	//Nhap_1(&x);

	//printf("\nx = %d", x);

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

	//Nhap_2(&y);
	Nhap(*y);
	printf("\ny = %d", *y);

	free(y);
	
	getch();
	return 0;
}


Output:
1
2
3
Line 17: error: conio.h: No such file or directory
Line 4: error: expected ';', ',' or ')' before '&' token
Line 8: warning: unknown escape sequence '\N'


Create a new paste based on this one


Comments: