goto or function pointer into this pseudo-code?
I have a doubt if to use `goto` or `pointer to a function` into my code. Here a pseuco C code using goto:
Code:
/* code that read the answer */
switch-case:
switch(answer)
case LIST:
goto list_files;
case PWD:
goto pwd;
case RETR:
goto retr_file;
where:
Code:
list_files:
/* all code needed to list files */
goto switch-case;
pwd:
/* all code needed to print the current working directory */
goto switch-case;
retr-file:
/* all code needed to retrive a file */
goto switch-case;
Regard the pseudo code with function pointer i have no idea on how to it xD
Can this be a good code? Because i think that using function pointer will complicate my program too much!