سلام وقت بخیر
لطفا درمورد ارور زیر توضیح بدید. نمیدونم مشکل از کجاست و کلی هم سرچ کردم. کد و ارور رو در پایین قرار میدم
ممنون
#include "lpc17xx.h"
#include "stdio.h"
#include "UART.h"
#include "delay.h"
char buffer[50];
typedef struct {
int x;
int y;
}point;
point midFinder ( point startpoint , point endpoint){
point midpoint;
midpoint.x = ( startpoint.x + endpoint.x) / 2;
midpoint.y = ( startpoint.y + endpoint.y) / 2;
return midpoint;
}
int main(void){
UART0_init();
typedef struct {
int x;
int y;
}point;
point A;
point B;
point C;
A.x = 3;
A.y = 4;
B.x = 5;
B.y = 2;
//اینجا جایی هست که میگه ارور داره
C = midFinder( A, B);
sprintf( buffer," midpointX : %d , midpointY : %d" , C.x , C.y);
while(1){
my_PutS(buffer);
delay(10);
}
}
این هم اروری هست که میده:
error: passing 'point' to parameter of incompatible type 'point'