69,373
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <machine.h>
int main(void)
{ float sale_price, height;
t_machine *a = machine.new("夏普", "2006", 0.83, 5000.0);
/* send messages */
sendMsg(a, printName);
sale_price = sendMsg(a, computeSalePrice);
height = sendMsg(a, inquireHeight);
printf("height : %.2f\n", height);
printf("sale_price : %.2f\n", sale_price);
/* delete object */
delete(a);
getch();
return EXIT_SUCCESS;
}