cho e hỏi là sao dòng void Nhap lại có &d còn dòng void Xuat lại k cần ạ. E thử trong Dev C thì để &d không chạy được ạ. E xin cảm ơn
#include<stdio.h>
#include<conio.h>
typedef struct DIEM{
int x;
int y;
}DIEM;
void Nhap(DIEM &d){
printf("\nNhap toa do diem\n");
printf("Hoanh do: ");scanf("%d",&d.x);
printf("Tung do: ");scanf("%d",&d.y);}
void Xuat(DIEM d){
printf("\nToa do diem: (%d,%d)",d.x,d.y);
}
DIEM Tong(DIEM d1,DIEM d2){
DIEM temp;
temp.x=d1.x+d2.x;
temp.y=d1.y+d2.y;
return temp;
}
int main(){
DIEM A,B,AB;
Nhap(A);Xuat(A);
Nhap(B);Xuat(B);
AB=Tong(A,B);
printf("\nTong: ");
Xuat(AB);
return 0;
}