ORBSLAM2源码学习之1-argv and argc

针对与slam 读取数据时的函数时argc[ ]

LoadImages(string(argv[3]), vstrImageFilenames, vTimestamps)

实例解释:

#include <iostream>
 using namespace std;

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

输出:
 

lsw@vslam:~/桌面$ g++  test.cpp  -o    test
lsw@vslam:~/桌面$ ./test  1 2 3
0:./test
1:1
2:2
3:3

猜你喜欢

转载自blog.csdn.net/weixin_39752599/article/details/82770397
今日推荐