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?

Was it helpful?

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!

OTHER TIPS

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

cd NiTE/Samples/Bin
./UserViewer
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top