I have a c++ program:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fstream>
#include <iostream>
#include <fcntl.h>
using namespace std;
int main (int argc, const char * argv[]) {
// system("script /dev/null");
FILE *pout;
pout = popen("screen tty.MobileRobot-RNI-SPP", "w");
fprintf(pout,"hello");
return 0;
}
The issue is that it then outputs "Must be connected to a terminal."
Which the command then hangs. Uncommenting that system() call doesn't cause anything to happen. I'm not sure if I'm doing it correctly. Any ideas? Thanks