I have a doubt if to use `goto` or `pointer to a function` into my code. Here a pseuco C code using goto:
where:Code:/* code that read the answer */ switch-case: switch(answer) case LIST: goto list_files; case PWD: goto pwd; case RETR: goto retr_file;
Regard the pseudo code with function pointer i have no idea on how to it xDCode: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;
Can this be a good code? Because i think that using function pointer will complicate my program too much!