Record Detail

Compile Error

In file included from /in/Compile/check.cpp:7:
/in/sokoban.hpp:18:35: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
      std::getline(std::cin, grid[i]);
                             ~~~~ ^
/in/sokoban.hpp:39:22: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            if (grid[i][j] == 'S') {
                ~~~~ ^
/in/sokoban.hpp:39:25: error: implicit conversion changes signedness: 'int' to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            if (grid[i][j] == 'S') {
                ~~~~    ^
/in/sokoban.hpp:43:22: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            if (grid[i][j] == 'B') {
                ~~~~ ^
/in/sokoban.hpp:43:25: error: implicit conversion changes signedness: 'int' to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            if (grid[i][j] == 'B') {
                ~~~~    ^
/in/sokoban.hpp:47:22: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            if (grid[i][j] == 'T') {
                ~~~~ ^
/in/sokoban.hpp:47:25: error: implicit conversion changes signedness: 'int' to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            if (grid[i][j] == 'T') {
                ~~~~    ^
/in/sokoban.hpp:75:63: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        return r >= 0 && r < row && c >= 0 && c < col && grid[r][c] != '#';
                                                         ~~~~ ^
/in/sokoban.hpp:75:66: error: implicit conversion changes signedness: 'int' to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        return r >= 0 && r < row && c >= 0 && c < col && grid[r][c] != '#';
                                                         ~~~~    ^
/in/sokoban.hpp:29:20: error: implicit conversion loses integer precision: 'std::vector::size_type' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
    int row = grid.size();
        ~~~   ~~~~~^~~~~~
/in/sokoban.hpp:30:23: error: implicit conversion loses integer precision: 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
    int col = grid[0].size();
        ~~~   ~~~~~~~~^~~~~~
11 errors generated.
/in/Compile/Makefile:16: recipe for target 'main' failed
make: *** [main] Error 1

Information

Submit By
Type
Submission
Homework
Project3
Language
C++
Submit At
2024-11-27 13:50:46
Judged At
2024-11-27 13:50:46
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes