okay. i checked and tryed all the ways to run an exe in the FAQ, but none of them worked. i don't know if those were ment for a C++ program or if it just don't work with my compiler. is there another way. thanks.
okay. i checked and tryed all the ways to run an exe in the FAQ, but none of them worked. i don't know if those were ment for a C++ program or if it just don't work with my compiler. is there another way. thanks.
Double click the pretty little icon...
Quzah.
Hope is the first step on the road to disappointment.
What in gods name are you talking about? How to click and run an exe? How to make one?
??
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
lol. sorry lookin over it now, forgot to put "Run an exe through another program written in C"
"What this country needs is more free speech worth listening to." - -Hansell B. Duckett
I really doubt you tried all the options in the FAQ then. If you had, you'd have found they all work.
Quzah.
Hope is the first step on the road to disappointment.
they don't work with me.
"What this country needs is more free speech worth listening to." - -Hansell B. Duckett
I guess I'll use my astounding mental powers to analize the code you have then, huh? I am seeing... Ah, yes, there it is. I see the problem.
Now you can use your astounding mental powers to read my mind, and get the answer.
Quzah.
Hope is the first step on the road to disappointment.
Assuming that you want to invoke one Win32 program from another, #include <windows.h> and use WinExec("program.exe", SW_SHOWNORMAL);.
>they don't work with me.
Fascinating that they work for everyone who uses them correctly yet you are having problems. The logical conclusion to this is that you're doing it wrong. Post your code and we'll tell you why and how to fix it.
-Prelude
My best code is written with the delete key.
ive tried:
1)
#include <windows.h>
main()
{
WinExec("myfile.exe");
}
2)
#include <stdlib.h>
int main(void)
{
system("myfile.exe");
return 0;
}
and spawn but already trashed that file
also there were some variables i n these but they caused errors when i tried to compile. these all compiled but didn't run the exe
"What this country needs is more free speech worth listening to." - -Hansell B. Duckett
Here ya go:
Save this as 'test.c'. Compile this as 'test.exe'. Run 'test.exe' from a command prompt. Enjoy.Code:#include <stdio.h> #include <stdlib.h> int main ( void ) { printf("Cascading doom.\n"); fflush( stdout ); system( "test.exe" ); return 0; }
Quzah.
Hope is the first step on the road to disappointment.
You could include absolute path in system() instead, as:
Code:system("C:\\Workarea\\test.exe");
Ooohh, you're evilOriginally posted by quzah
Here ya go:
<snip code>
Save this as 'test.c'. Compile this as 'test.exe'. Run 'test.exe' from a command prompt. Enjoy.
Quzah.
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
No, I'm being helpful and showing that it does in fact work. (It doesn't in fact work in MSVC++ until you run it from the command prompt rather then the IDE. Very odd.Originally posted by Hammer
Ooohh, you're evil
Quzah.
Hope is the first step on the road to disappointment.
that has to do with the IDE search path.. if that is set to the right dir it will work.