@crunklord420 I want to write a CLI program in C. The idea is that once i run this program from a terminal, I am put in a CLI program where I can type various commands with arguments that I defined and they will be executed. What is the best/fastest way for such a program to work? Should i just make switch statements where each one is just the string of the command? And then if the string matches, I call the corresponding function? Or is there a better way to do this?
@Saxophone3784 also, technically the autistically fastest way would be hash your strings instead of doing an actual string comparison. I've done this before with xxhash for larger lookup tables. gperf also does this: https://developer.ibm.com/tutorials/l-gperf/
You don't need to do this, it's really for much larger lookup tables.