参考链接:https://www.cnblogs.com/kileyi/p/10163269.html
举例:Test_Bluetooth.exe -help
Test_Bluetooth.cpp
#include "pch.h" #include <iostream> using namespace std; void help() { cout << "help" << endl; } int main(int argc, char* argv[]) { if (argc == 2) { if (strcmp(argv[1], "-help") == 0) { help(); } } else { cout << "Hello World!\n"; } }