I am working with a simple command line application that takes in ASCI text and interprets it as a command.
I have attempted to minimize the redundancy in this appli
Question:
Is there any method using the C preprocessor that would allow me to create a macro creates the "command" struct (with string and int members), and auto-numbers the int value (command_idx) as I add more commands via the COMMAND() macro?
Yes, and since you have tagged the question also as C++:
#include
#include
I just used map
instead of fancy new C++11 hash table because map
works with older compilers and no real need for shaving nano-seconds here.
Cheers & hth.,