4 ms·
Another perspective (as a rhetorical question): Why does "command line argument(s)" have to be an array of strings, rather than a single string? Like, consider
by smilekzs 9y ago
Another perspective (as a rhetorical question): Why does "command line argument(s)" have to be an array of strings, rather than a single string? Like, consider an alternative universe where C had `int main(const char* arg)`.
- pwdisswordfish 9y agoYou mean, like this alternative universe? https://msdn.microsoft.com/en-us/library/windows/desktop/ms633559(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/ms6... Flipping this around, why does the 'command line' have to be a string (or a list of strings) that my program has to parse, rather than a ready-to-be-used data structure? Consider instead an alternative universe where the command-line arguments to your program are represented with something like a JSON object. Or better, a struct that the command-line interpreter can type-check.