Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > .exe files...

Reply
Thread Tools

.exe files...

 
 
Services of TKO
Guest
Posts: n/a
 
      08-02-2004
Can i open each *.exe file in C++?

Greetings Services of TKO


 
Reply With Quote
 
 
 
 
JKop
Guest
Posts: n/a
 
      08-02-2004
Services of TKO posted:

> Can i open each *.exe file in C++?
>
> Greetings Services of TKO
>
>
>


Yes, just as you can open each bag in a radiator.

If you have any intelligible questions, in which the
selection of nouns you use actually make sense, then by
all means ask them.


-JKop
 
Reply With Quote
 
 
 
 
Stephen Tyndall
Guest
Posts: n/a
 
      08-02-2004
"Services of TKO" <(E-Mail Removed)> wrote in message
news:8UuPc.130$(E-Mail Removed)...
> Can i open each *.exe file in C++?


If you mean dive into the code by opening the *.exe file in your editor,
then no. The only file types modifiable by C++ are the following types:

Source file: *.cpp (C++ code), *.c (C code)
Header file: *.h, *.hpp, *.hxx (not sure that last one's right)

I think I'm missing a couple, but oh well. If you've created a program and
you build it from the source/header files, you can run the program, but I'm
not sure that's what you're looking for since you can just run any program
by double-clicking on it.

I think you probably need to check out some web resources like
cplusplus.com, because I'm not sure you know what C++ is at this point.
Also, you should probably read the comp.lang.c++ FAQ at
www.parashift.com/c++-faq-lite/
Good luck getting started at C++!

//mike tyndall


 
Reply With Quote
 
Victor Bazarov
Guest
Posts: n/a
 
      08-02-2004
Services of TKO wrote:
> Can i open each *.exe file in C++?


What do you mean by that? Files (whether with 'exe' extension
or with any other) can be open/read/written to/closed by means
of 'fstream' family of classes. So, generally speaking, the
answer to your [very unclear] question is "yes, it is generally
possible".

Victor
 
Reply With Quote
 
Ralph D. Ungermann
Guest
Posts: n/a
 
      08-02-2004
Services of TKO wrote:
> Can i open each *.exe file in C++?


Yes, if you have read access to the file:

#include <fstream>
....
std::ifstream exe( "c:\\winnt\\notepad.exe",
std::ios::in|std::ios::binary );



But I feel, that this is not, what you asked for. So let me guess:

Did you mean "execute", when you said "open"?

Then, yes again:

#include <cstdlib>
....
system( "c:\\winnt\\notepad.exe" );

This is a standard C function, but the effects are system dependent
(even among various MS-flavors).



Or did you mean sort of "integrate the executable into your favourite
C++ Programming Environment"?

Then, you should ask in a newsgroup designated to your IDE (Borland,
MSVC++, Eclipse?).


Ralph
 
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




Advertisments