[ create a new paste ] login | about

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

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

struct Ngay
{
       int Day, Month, Year;
};
typedef Ngay NGAY;
struct CauThu
{
	char MaCauThu[20];
	char TenCauThu[30];
	NGAY NgaySinh;
};
typedef CauThu CAUTHU;
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("%d-%d-%d", ng.Day, ng.Month, ng.Year);
}

void NhapCauThu(CAUTHU &a)
{
	fflush(stdin);
	printf("Nhap ma cau thu: \n");
	gets(a.MaCauThu);

	fflush(stdin);
	printf("Nhap ten cau thu: \n");
	gets(a.TenCauThu);

	printf("Nhap ngay sinh: \n");
	NhapNgay(a.NgaySinh);
}

void XuatCauThu(CAUTHU a)
{
	printf("Ma cau thu: %s\n", a.MaCauThu);
	printf("Ten cau thu: %s\n", a.TenCauThu);
	printf("Ngay sinh: \n");
	XuatNgay(a.NgaySinh);
}

int main()
{
	CAUTHU a;
	NhapCauThu(a);
	XuatCauThu(a);

	getch();
	return 0;
}


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Line 17: error: conio.h: No such file or directory
Line 8: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'NGAY'
Line 13: error: expected specifier-qualifier-list before 'NGAY'
Line 15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'CAUTHU'
Line 16: error: expected ')' before '&' token
Line 27: error: expected ')' before 'ng'
Line 32: error: expected ')' before '&' token
Line 46: error: expected ')' before 'a'
In function 'main':
Line 56: error: 'CAUTHU' undeclared (first use in this function)
Line 56: error: (Each undeclared identifier is reported only once
Line 56: error: for each function it appears in.)
Line 56: error: expected ';' before 'a'
Line 57: error: 'a' undeclared (first use in this function)


Create a new paste based on this one


Comments: