I wanna use string to input a path of file. Code Sample:
char** argv;
char* mytarget[2]={ (char*)"D:\\testlas\\BigOne.pcd",(char*)"D:\\testlas\\SmallOne.pcd" };
argv = mytarget;
for(int i=0;i<2;i++)
{
std::cout << "m.name: " << argv[i] <<std::endl;
}
However, the cout outputs:
m.name: ?D:\testlas\BigOne.pcd m.name: ?D:\testlas\SmallOne.pcd
Why there is a "?" before the string? I use VS2017 c++11.
Then I create a new program and input the code:
#include<iostream>
#include<string>
using namespace std;
int main{
std::string test = "abc789";
cout << test << endl;
return;
}
There it also outputs "?abc789". enter image description here enter image description here
Aucun commentaire:
Enregistrer un commentaire