terminal problem

i am executiing some commands using system an popen command in c.
while executing the code .
some data is shown on terimal without using any print statement.
how can i solve this problem
thank u
sree

i am not sure but, i could be the following reason:

Open descriptors are inherited to child process, this may cause the use of resources unneccessarily. Unneccesarry descriptors should be closed before fork() system call (so that they are not inherited) or close all open descriptors as soon as the child process starts running.

	for (i=getdtablesize();i>=0;--i) close(i); /* close all descriptors */

There are three standart I/O descriptors: standart input 'stdin' (0), standart output 'stdout' (1), standart error 'stderr' (2). A standard library routine may read or write to standart I/O and it may occur to a terminal or file. For safety, these descriptors should be opened and connectedthem to a harmless I/O device (such as /dev/null).

i=open("/dev/null",O_RDWR); /* open stdin */
	dup(i); /* stdout */
	dup(i); /* stderr */

As Unix assigns descriptors sequentially, fopen call will open stdin and dup calls will provide a copy for stdout and stderr.

Be aware that system() from <cstdlib> or <stdlib.h> is sth. like a wrapper for fork() and exec(). popen() too as far as is know.

But, try this.

I would be helpfull if we knew what you are executing and what output you have on the screen.
cheeers