Why am i getting these errors around this function? Why does it keep saying these stuffs?
1>------ Build started: Project: makealine, Configuration: Debug Win32 ------
1> game.cpp
1>h:\year2\console_programming_conprg\course_work\dump\makealine\makealine\game.cpp(780): error C2361: initialization of 'validpos' is skipped by 'default' label
1> h:\year2\console_programming_conprg\course_work\dump\makealine\makealine\game.cpp(758) : see declaration of 'validpos'
1>h:\year2\console_programming_conprg\course_work\dump\makealine\makealine\game.cpp(780): error C2361: initialization of 'pathway' is skipped by 'default' label
1> h:\year2\console_programming_conprg\course_work\dump\makealine\makealine\game.cpp(757) : see declaration of 'pathway'
1>h:\year2\console_programming_conprg\course_work\dump\makealine\makealine\game.cpp(780): error C2361: initialization of 'Move_Piece' is skipped by 'default' label
1> h:\year2\console_programming_conprg\course_work\dump\makealine\makealine\game.cpp(754) : see declaration of 'Move_Piece'
1>h:\year2\console_programming_conprg\course_work\dump\makealine\makealine\game.cpp(780): error C2361: initialization of 'uiPiece' is skipped by 'default' label
1> h:\year2\console_programming_conprg\course_work\dump\makealine\makealine\game.cpp(751) : see declaration of 'uiPiece'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
bool ComputerAI_Move()
{
//...
switch(Check_If_Player_Pieces_Max())
{
casetrue://Player has 3 pieces
//////////////////////////////////////////////////
///////////////////////////////////////////////////
//choose piece number to move
srand(99);
unsignedint uiPiece = (unsignedint)(rand() % 3);
//find piece chosen to be moved
unsignedchar Move_Piece = Cycle_to_locate_piece(uiPiece);
//Locate valid path & make move if true
unsignedchar pathway = 0;
unsignedchar Store_valid_moves[9]; unsignedchar validpos = 0;
if(!find_valid_movepath(uiPiece,Move_Piece,pathway,Store_valid_moves,validpos))
{
//location contains no valid moves so try another location
uiPiece = 0;//use "uiPiece" to loop through all pieces so the valid version
//may be found
while (uiPiece < 3)
{
if (find_valid_movepath(uiPiece,Move_Piece,pathway,Store_valid_moves,validpos))
{
returntrue; //TERMINATE FUNCTION
//break;/*valid move found*/
}
uiPiece++; //try another piece
}
}
break;
//////////////////////////////////////////////////
///////////////////////////////////////////////////
default://Player has no three pieces
//Randomly_Place_Piece : returns true if valid move entered
return Randomly_Place_Piece();
break;
//////////////////////////////////////////////////
///////////////////////////////////////////////////
}
}