judgerrunbf45ae74f18f426f9ee34ea41bd1af51mainc In function mainjudgerrunbf45ae74f18f426f9ee34ea41bd1af51mainc852 error unknown type name Robot; use struct keyword to refer to the type 85 Robot rob
The code you provided has multiple errors.
The first error is that the type Robot is unknown. To fix this, you need to define the struct Robot before using it:
struct Robot {
int blood;
int x;
int y;
};
The second error is that you are trying to access the blood member of robot without using the dot operator on a structure or union. To fix this, you need to use the dot operator:
robot.blood = 100;
The third error is similar, you are trying to access the x member of robot without using the dot operator:
robot.x = 0;
After making these changes, your code should compile without errors
原文地址: https://www.cveoy.top/t/topic/hN9I 著作权归作者所有。请勿转载和采集!