Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char *comand = new char[query.length()]; // Create pointer to store the query
- strcpy(comand, query.c_str()); // Convert the query to char [] which is the necessary format for the write command.
- int n_written = 0;
- int spot = 0;
- do {
- n_written = write( USB, &comand[spot], 1 );
- spot += n_written;
- } while (comand[spot-1] != 'n' && n_written > 0);
- delete[] comand;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement