yeswell: во втором коде ошибок нет, игра просто мертва
ошибки в первом коде:
||=== Build: Debug in Game (compiler: GNU GCC Compiler) ===|
Battleship Cruiser\Chaze.cpp||In member function 'int level::level_obj(SDL_Surface*)':|
Battleship Cruiser\Chaze.cpp|23|warning: no return statement in function returning non-void [-Wreturn-type]|
Battleship Cruiser\Chaze.cpp||In function 'int SDL_main(int, char**)':|
Battleship Cruiser\Chaze.cpp|46|error: conflicting declaration 'level screen'|
Battleship Cruiser\Chaze.cpp|31|note: previous declaration as 'SDL_Surface* screen'|
Battleship Cruiser\Chaze.cpp||In member function 'int cruiser::cruiser_obj(SDL_Surface*, level)':|
Battleship Cruiser\Chaze.cpp|59|error: expected primary-expression before '.' token|
Battleship Cruiser\Chaze.cpp|60|error: expected primary-expression before '.' token|
Battleship Cruiser\Chaze.cpp|69|error: expected primary-expression before '.' token|
Battleship Cruiser\Chaze.cpp|70|error: expected primary-expression before '.' token|
Battleship Cruiser\Chaze.cpp|71|warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]|
Battleship Cruiser\Chaze.cpp|71|warning: statement has no effect [-Wunused-value]|
Battleship Cruiser\Chaze.cpp|77|error: expected primary-expression before '.' token|
Battleship Cruiser\Chaze.cpp|78|error: expected primary-expression before '.' token|
Battleship Cruiser\Chaze.cpp|79|warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]|
Battleship Cruiser\Chaze.cpp|79|warning: statement has no effect [-Wunused-value]|
Battleship Cruiser\Chaze.cpp|87|error: expected primary-expression before '.' token|
Battleship Cruiser\Chaze.cpp|88|error: expected primary-expression before '.' token|
||=== Build failed: 9 error(s), 5 warning(s) (0 minute(s), 0 second(s)) ===|
так или иначе это не решает проблему(
я новичок и много не знаю в синтаксисе
неужели такая тяжёлая задача? уже сколько человек спросил..
по сути я просто неправильно вызываю функцию и неправильно передаю в неё значение.. я это и сам понимаю, а как сделать я не знаю
не компилится так как вы сказали
вылетает ошибка
||=== Build: Debug in Game (compiler: GNU GCC Compiler) ===|
Battleship Cruiser\Chaze.cpp|26|error: field 'cruiser' has incomplete type 'cruiser'|
Battleship Cruiser\Chaze.cpp||In constructor 'cruiser::cruiser(SDL_Surface*)':|
Battleship Cruiser\Chaze.cpp|58|error: expected primary-expression before '.' token|
Battleship Cruiser\Chaze.cpp|59|error: expected primary-expression before '.' token|
Battleship Cruiser\Chaze.cpp|68|error: expected primary-expression before '.' token|
Battleship Cruiser\Chaze.cpp|69|error: expected primary-expression before '.' token|
Battleship Cruiser\Chaze.cpp|70|warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]|
Battleship Cruiser\Chaze.cpp|70|warning: statement has no effect [-Wunused-value]|
Battleship Cruiser\Chaze.cpp|76|error: expected primary-expression before '.' token|
Battleship Cruiser\Chaze.cpp|77|error: expected primary-expression before '.' token|
Battleship Cruiser\Chaze.cpp|78|warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]|
Battleship Cruiser\Chaze.cpp|78|warning: statement has no effect [-Wunused-value]|
Battleship Cruiser\Chaze.cpp|86|error: expected primary-expression before '.' token|
Battleship Cruiser\Chaze.cpp|87|error: expected primary-expression before '.' token|
||=== Build failed: 9 error(s), 4 warning(s) (0 minute(s), 0 second(s)) ===|