.exe files...

  • Thread starter Services of TKO
  • Start date
J

JKop

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
 
S

Stephen Tyndall

Services of TKO said:
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
 
V

Victor Bazarov

Services said:
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
 
R

Ralph D. Ungermann

Services said:
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
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top