Question

I tried the code I found here, the second one, but it doesn't work. Actually, during the execution I try to push 's' button but it doesn't save anything. I tried also to use breakpoints in debug mode, but never change the value of the variable char c. What happens?

Était-ce utile?

La solution 2

I solved in the following manner. I substituted this code:

std::string c;
std::getline (std::cin,c); 
std::string str2 ("s\n");
if( str2.compare(c)) {//as before}

to that provided:

c = getchar(); 
if( c == 's' ){}

With my solution it works well!

Autres conseils

Have you tested your sensor? You can download for example NiTE and run:

cd NiTE/Samples/Bin
./UserViewer
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top