Browse Source

refactoring: commend a function

remotes/origin/georg
KaffeeMaus 11 months ago
parent
commit
d4a4b71eb3
  1. 4
      src/main/c/Georg/tictactoe.c

4
src/main/c/Georg/tictactoe.c

@ -64,11 +64,11 @@ int handleCommand( char* input ){
commandFunction getCommandById( int id ){
commandFunction result = NULL;
size_t arraySize = sizeof(COMMANDS) / sizeof(COMMANDS[0]);
size_t arraySize = sizeof(COMMANDS) / sizeof(COMMANDS[0]); // calculate size of Array
for (size_t i = 0; i < arraySize; i++) {
//printf( "%s", COMMANDS[i].description );
if( COMMANDS[i].id == id ){
result = COMMANDS[i].fun;
result = COMMANDS[i].fun; // save the function pointer as result
break;
}
}

Loading…
Cancel
Save