Solved

Question in C

Posted on 2000-03-08
4
207 Views
Last Modified: 2010-04-02
How can i run a executable file(other than c file ) such as a .class file
from a c program ??
0
Comment
Question by:yammanur
  • 3
4 Comments
 
LVL 1

Expert Comment

by:dmaguillo
ID: 2595545
All you need is execute from your command prompt (for a java .class):

   java mainfile.class (main application)
   appletviewer miapplet.class

You must specify this command lines in your c function for execute programs from command prompt.

Bye... :)
0
 
LVL 22

Expert Comment

by:nietod
ID: 2595610
Is a .class file executable?   I've never heard of it.

You can run any executable program (anything you can run from a command line) using the system() command.  Like

system("C:\PROGRAMMS\\WINWORD.EXE");

will run the WINWORD.EXE program.

In addition, there may be other ways to run programs on your operating system.  But since you didn't say what operating system you are using so we can't suggest any.
0
 
LVL 22

Accepted Solution

by:
nietod earned 95 total points
ID: 2600155
What is going on here?  Why did you reject my answer?
0
 
LVL 22

Expert Comment

by:nietod
ID: 2604212
You don't have to accept it if it doesn't help you, but you do need to explain why it didn't help you.   When you reject and answer with no comment, it is not clear what was wrong so no one knows what to help you.  Also it looks like you might be cheating the system--rejecting a correct answer so you don't have to pay for it.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question