Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Opening file in c++

Reply
Thread Tools

Opening file in c++

 
 
sam
Guest
Posts: n/a
 
      09-11-2008
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
 
Reply With Quote
 
 
 
 
Tim Slattery
Guest
Posts: n/a
 
      09-11-2008
sam <> wrote:

>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.

--
Tim Slattery

http://members.cox.net/slatteryt
 
Reply With Quote
 
 
 
 
Erik Wikström
Guest
Posts: n/a
 
      09-11-2008
On 2008-09-11 14:44, sam wrote:
> 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.

--
Erik Wikström
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with opening Excel after opening Excel inside Microsoft Internet Controls fniles ASP General 0 04-26-2009 09:39 PM
Anyone resolved links opening blank page? or box opening in Outlook 2000? S.Rodgers Firefox 13 12-16-2005 03:07 PM
Word file not opening from Adm -My recent docs but opening from file menu of Word Thaqalain Computer Support 0 06-30-2005 02:20 AM
opening file - file does not exist but no error ben C++ 10 02-25-2004 09:12 PM
need some help with dial box opening when opening a folder John Computer Information 0 11-13-2003 08:38 PM



Advertisments