#include <stdio.h>
struct Complex
{
double x;
double y;
};
void Add(struct Complex*p, struct Complex*q, struct Complex*r)
{
struct Complex r;
r->x = p->x + q->x;
r->y = p->y + q->y;
}
void Multiply(struct Complex*p, struct Complex*q, struct Complex*r)
{
r->x = (p->x)*(q->x) - (p->y)*(p->x);
r->y = (p->x)*(q->y) + (p->y)*(q->x);
}
int main()
{
struct Complex a,b,result;
scanf("%lf %lf", &a.x, &a.y);
Add(&a, &b, &result);
Multiply(&a, &b, &result);
return 0;
}
여기서 오류가 'r' 정식 매개 변수 재정의를 하라는 게 나왔는데 어떻게 해야하나요?
그리고 출력은 어떻게 해야하나요
add 인자하고 이름이 겹치자나
그러면 혹시 어떻게 고쳐하는지 알 수 있을까요?