[ create a new paste ] login | about

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

C, pasted on Dec 1:
#include<stdio.h>
#include<conio.h>

struct Ngay
{
       int Day, Month, Year;
};
typedef Ngay NGAY;

void NhapNgay(NGAY &);
void XuatNgay(NGAY);

void NhapNgay(NGAY &ng)
{
	printf("\nNhap ngay: ");
	scanf("%d", &ng.Day);

	printf("\nNhap thang: ");
	scanf("%d", &ng.Month);

	printf("\nNhap nam: ");
	scanf("%d", &ng.Year);
}
void XuatNgay(NGAY ng)
{
	printf("\n%d-%d-%d",ng.Day, ng.Month, ng.Year);
}

int main()
{
	NGAY ng;
	NhapNgay(ng);
	XuatNgay(ng);

	getch();
	return 0;
}


Output:
1
2
3
4
5
6
7
8
9
10
11
12
Line 17: error: conio.h: No such file or directory
Line 8: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'NGAY'
Line 10: error: expected ')' before '&' token
Line 11: warning: parameter names (without types) in function declaration
Line 13: error: expected ')' before '&' token
Line 24: error: expected ')' before 'ng'
In function 'main':
Line 31: error: 'NGAY' undeclared (first use in this function)
Line 31: error: (Each undeclared identifier is reported only once
Line 31: error: for each function it appears in.)
Line 31: error: expected ';' before 'ng'
Line 32: error: 'ng' undeclared (first use in this function)


Create a new paste based on this one


Comments: