[ create a new paste ] login | about

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

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

struct DiemKG
{
	float x;
	float y;
	float z;
};
typedef struct DiemKG DIEMKG;

void NhapDiemKG(DIEMKG &);
void XuatDiemKG(DIEMKG);

void NhapDiemKG(DIEMKG &d)
{
	float temp;
	printf("\nNhap x: ");
	scanf("%f", &temp);
	d.x = temp;

	printf("\nNhap y: ");
	scanf("%f", &temp);
	d.y = temp;

	printf("\nNhap z: ");
	scanf("%f", &temp);
	d.z = temp;
}

void XuatDiemKG(DIEMKG d)
{
	printf("(%8.3f, %8.3f, %8.3f)", d.x, d.y, d.z);
}

int main()
{
	DiemKG d;
	NhapDiemKG(d);
	XuatDiemKG(d);

	getch();
	return 0;
}


Output:
1
2
3
4
5
6
7
8
9
Line 17: error: conio.h: No such file or directory
Line 12: error: expected ';', ',' or ')' before '&' token
Line 15: error: expected ';', ',' or ')' before '&' token
In function 'main':
Line 38: error: 'DiemKG' undeclared (first use in this function)
Line 38: error: (Each undeclared identifier is reported only once
Line 38: error: for each function it appears in.)
Line 38: error: expected ';' before 'd'
Line 39: error: 'd' undeclared (first use in this function)


Create a new paste based on this one


Comments: