C语言实现面向对象多态的过程发生报错(快写完了),在mian.c中运行print prectangle时编译成功,而在写pcircle时却显示未定义标识符,可是我在头文件中对rectangle和circle的编写逻辑一模一样啊,求告知!
#include"Rectangle.h"
#include"Circle.h"
#include<stddef.h>
#include<stdio.h>
int main(void) {
Rectangle* pRectangle = Rectangle_creat(2.0,1.5);
if (NULL == pRectangle) {
return -1;
}
Circle * pCircle = Circle_creat(10.0);
if (NULL == pCircle) {
return -1;
}
double rectangleArea = Rectangle_calcArea(pRectangle);
printf("%f\n", rectangleArea);
double circleArea=Circle_calcArea(pCircle);
printf("%f\n", pCircle);
Rectangle_destroy(pRectangle);
pRectangle = NULL;
Circle_destroy(pCircle);
pCircle = NULL;
return 0;
}