Writing popen() output to a file.
I've been trying to call another program from c++, and save the stout of that program to a text file. popen() seems to be the appropriate function, but saving it to a text file isn't working. 

          ofstream delaunayfile;
  		delaunayfile.open ("triangulation/delaunayedpoints.txt");
		  FILE *fp;
		  fp = popen("qdelaunay < triangulation/rawpoints.txt", "r");
  		delaunayfile << fp;
  		delaunayfile.close();

Any help? Thanks in advance!
Writing popen() output to a file.
===

I've been trying to call another program from c++, and save the stout of that program to a text file. popen() seems to be the appropriate function, but saving it to a text file isn't working. 

          ofstream delaunayfile;
  		delaunayfile.open ("triangulation/delaunayedpoints.txt");
		  FILE *fp;
		  fp = popen("qdelaunay < triangulation/rawpoints.txt", "r");
  		delaunayfile << fp;
  		delaunayfile.close();

Any help? Thanks in advance!