Call a funvtion from a variable

This is a discussion on Call a funvtion from a variable within the C Programming forums, part of the General Programming Boards category; Hi there. I am trying to implement a very basic shell for a flat file system. Anyhow, my shell will ...

Call a funvtion from a variable

Hi there. I am trying to implement a very basic shell for a flat file system. Anyhow, my shell will be very simple for now. It will be an endless while loop where I prompt for input and after reading it in a string with fgets I use sscanf to break it up ( I suppose I could use a delimiter as well but since all comands are separated by spaces I guess it's okay)
and then I was thinking of how to call the appropriate function.
I thought of comparing the command with all available commands or using table with pointer (well actually I havent thought much about that yet, just that it came to me that maybe I could use funtion pointers) but I wanted to ask here first (I searched a little but couldnt find anything helping me as far aas c is concerned)
Is there any way to use a string variable to call a function

Yeah, I know I am a bother but could someone explain the above a little to me. As I said it was just a hunch but I really don't understand it fully yet. Or some link with explanation and/or examples
Am I to creata a table with strings (the names of the functions) and next to them have a pointer to that function. So I search and compare the table and if succesfull call the pointer next to it? But then what type of pointer will I put. Some gunctions take no arguments while other take various. Dont I need to make a pointer to the exact type of function