By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,778 Members | 1,947 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,778 IT Pros & Developers. It's quick & easy.

.exe files...

P: n/a
Can i open each *.exe file in C++?

Greetings Services of TKO
Jul 22 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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
Jul 22 '05 #2

P: n/a
"Services of TKO" <TK**********@hotmail.com> wrote in message
news:8U****************@news.zonnet.nl...
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
Jul 22 '05 #3

P: n/a
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
Jul 22 '05 #4

P: n/a
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
Jul 22 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.