Hello sir,

I am doing project on processors. I have a program called "START" and another program called "main". Now, i want to execute "START" program within the "main". I do not want to just call instead i want to run the "START" Program. please help me..


Thanku
Krutthika

Try

system("sh test");
system("test.exe");

i think you will need the header 'process.h' for this.

1> you dont need to create separate threads for same problem. you could have 'edit'ed your earlier post instead or if it was replied to you could have again 'replied' with your query.
2>system should execute any executable, it need not have a .exe extension, as per my understanding if you're on *NIX you can give the name of any file which has execute permission.

hello ,
Thanks for replying..
I shlould not use .exe file in my program. I need to execute when i call the "START" program in the "MAIN" .. Please help

what is 'START' program? is it a shell script or is it a .exe file? Are you on windows or *NIX?

Hello,

"START" is a c++ program , within that program i have written 3 programs - bubble sort, concatenation, string read programs written using functions. I have seperated all these functions and stored in a seperate files without headers.. Now, I have to write a program for accepting the functions by calling it then execute these functions seperately. Execution is done seperately by writing 3 accepting programs. For that i have to write a program for accepting the functions then execute those functions. Example consider "MAIN" is accepting program and it accepts Bubble sort function then Bubble sort function should execute and "MAIN" should also execute. Now my question is How to execute a program within another program?? Please guide.

Thank you once again..
Krutthika

Why do you need to write and call separate c++ programs for each of these functions to execute? Is there a special requirement to do this? Was writing different function not allowed? if you still have to do it i think you can do this by using the 'system' command and giving the program name without any extension. I still fail to understand the requirement though and would like to attach a 'Do at your own risk' tag to it :)

Just out of curiosity, you do know that if you call a function from 'MAIN', main will not terminate till the control returns back from the function, right?

Hello sir,
That is the assignment given to me.. Is their any subroutine type to call a program and execute then continue the main program?? As we do in 8085 processors...

Thanku
Krutthika

This article has been dead for over six months. Start a new discussion instead.