Record Detail

Compile Error

/in/simulation.cpp: In function 'void infect(world_t&, grid_t&, creature_t&)':
/in/simulation.cpp:195:18: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for(int i=0;i<world.numCreatures;i++){
                 ~^~~~~~~~~~~~~~~~~~~
/in/simulation.cpp:196:138: error: no match for 'operator=' (operand types are 'creature_t' and 'creature_t*')
         if(world.creatures[i].location.r==creature.location.r && world.creatures[i].location.c==creature.location.c) world.creatures[i]=&creature;
                                                                                                                                          ^~~~~~~~
In file included from /in/simulation.h:5:0,
                 from /in/simulation.cpp:8:
/in/compile/world_type.h:88:8: note: candidate: constexpr creature_t& creature_t::operator=(const creature_t&)
 struct creature_t
        ^~~~~~~~~~
/in/compile/world_type.h:88:8: note:   no known conversion for argument 1 from 'creature_t*' to 'const creature_t&'
/in/compile/world_type.h:88:8: note: candidate: constexpr creature_t& creature_t::operator=(creature_t&&)
/in/compile/world_type.h:88:8: note:   no known conversion for argument 1 from 'creature_t*' to 'creature_t&&'
cc1plus: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Project 3
Language
C++
Submit At
2024-11-13 23:45:08
Judged At
2024-11-13 23:45:08
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes