問題:
What is the best way of parsing command-line arguments in C++ if the program is specified to be run like this:如果程序被指定爲這樣運行,那麼在 C++ 中解析命令行參數的最佳方法是什麼:
prog [-abc] [input [output]]
Is there some way of doing this built into the standard library, or do I need to write my own code?標準庫中是否有某種方法可以做到這一點,還是我需要編寫自己的代碼?
Related:有關的:
解決方案:
參考一: https://en.stackoom.com/question/3dCO參考二: https://stackoom.com/question/3dCO