Opening file in c++

S

sam

Sir,

I just wanted to know how i will opened file (any exe or other
type file )in c++ and run it.
and how we will give path when we are opening it.
please give me the code of this small program.


thanks in advance
 
T

Tim Slattery

sam said:
Sir,

I just wanted to know how i will opened file (any exe or other
type file )in c++ and run it.
and how we will give path when we are opening it.
please give me the code of this small program.

That depends on what operating system you're using. Linux/Unix would
use a "fork" call, Windows programs would use something in the Win32
API. You should ask in a platform-specific group (or consult your
system documentation), it's off-topic here.
 
E

Erik Wikström

Sir,

I just wanted to know how i will opened file (any exe or other
type file )in c++ and run it.
and how we will give path when we are opening it.
please give me the code of this small program.

You can use system() to run another program, but I would strongly
discourage its use. There are other ways to execute another program but
they are all platform dependent, but many platforms are more or less
POSIX compatible and supports exec() and friends.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top