PDA

View Full Version : readStdout ( plz help needed urgently)



shrikarcse
3rd April 2006, 12:39
hey i am stuck with this prob plz tell me what is the prob.
this is a c file
#include<stdio.h>
main()
{
FILE *fp;
fp=fopen("hello","w");
fprintf(fp,"%s","hello");
fclose(fp);
printf("hello");
}
now i have generated a executable like $gcc hello.c -o myexec

now there is a form and a button called run
now i have done some thing like this in the slot run
QProcess *proc=new QProcess(0);
proc->addArgument("/home/shrikar/myexec");
if(!proc->start())
{
// error message
}
else
{
QString *str=(QString*)proc->readLineStdout( );
// now if i print this its not giving any out put neither it is writing anything to the file hello
}

now my second question is what if the executable is a image like a mandelbrot set.

plz help me (urgent)

zlatko
3rd April 2006, 13:04
Read this thread (http://www.qtcentre.org/forum/showthread.php?t=1023&highlight=stdout)