最近学习pcl,学习C++,今天让main的参数接收数据,想起没用过这样的,不知道怎么在vs里面调试

因此找了下方法,并记录下来

代码

#include<iostream>

int main(int argc, char** argv) {
    std::cout << "参数数量为:"<<argc<<std::endl;
    for (int i = 0; i < argc; i++) {
        std::cout << argv[i] << std::endl;
    }
    system("pause");
    return 0;
}

 右键项目—》属性—》调试—》命令参数

VS 2015main函数带参数的调试

运行结果

VS 2015main函数带参数的调试

 

相关文章:

  • 2022-12-23
  • 2021-12-22
  • 2021-06-08
  • 2022-12-23
  • 2022-02-11
  • 2022-12-23
  • 2022-12-23
  • 2021-08-31
猜你喜欢
  • 2022-12-23
  • 2022-02-17
  • 2022-12-23
  • 2021-10-30
  • 2021-06-20
  • 2021-10-22
  • 2021-12-05
相关资源
相似解决方案