参考链接: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";
    }
}
View Code

相关文章:

  • 2021-05-25
  • 2021-06-10
  • 2021-07-12
  • 2022-12-23
  • 2021-08-01
  • 2021-08-06
  • 2021-06-13
  • 2021-10-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-18
  • 2021-08-29
相关资源
相似解决方案