Lemme take a guess:
A never ending loop of spawns of an exe?
welll... this is something to annoy friends... its pretty funny..(DONT START IT ONCE YOU EXECUTED IT)
#include <stdio.h>
#include <windows.h>
#include <conio.h>
int open = 0;
int file;
int main() {
char exe[30];
if(open == 0){
printf("Something Funny");
printf("LOL");
scanf("%s",&exe);
open = 1;
file = exe;
return(main());
}
else {
restartfile();
return(main());
}
}
int restartfile ()
{
if (!system(file)) {
system(file);
}
}
Lemme take a guess:
A never ending loop of spawns of an exe?
BRING BACK BT, BRING BACK SAGA, BRING BACK VF, BRING BACK MPGHCRAFT, BRING BACK HABAMON
im guessing it really spawns messages... which never end... and will have to be closed through task manager or the person will have to restart thier comp :P
Weird code...
So if the operating system couldn't execute 'file' (which is of type int...) then it tries to execute 'file' before calling main() recursively.
Would it perhaps be better to not include the variable 'file' and instead call system(exe)?
Something like this? I'm not sure about your code, but this seems to compile without errors or warnings...
I have to admit, this is really quite uneventful stuff...Code:#include <stdio.h> #include <windows.h> #include <conio.h> int open = 0; int restartfile (char filename[]); int main() { static char exe[30]; if(open == 0) { printf("Something Funny"); printf("LOL"); scanf("%s", exe); open = 1; return(main()); } else { restartfile(exe); return(main()); } } int restartfile (char filename[]) { if (!system(filename)) { system(filename); } return 0; }