-
system();
im using lcc-win32 compiler
program runs under dos
this is my problem => i want to work with system();
Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int system();
system(" ren C:\\lamb.txt lamb.lamb");
return 0;
}
now this thing works on my computer but if i send it to other ppl it wont work it will only work on the comp where it has been compiled =>is this because of the compiler or is system(); just like that ....
-
comments:
lcc-win32 produces win32 executables. your programs are not running under dos.
why do you prototype system()? just include the proper header file.
-
i use lcc i include the proper header file according to the help thing in lcc its stdlib.h it works perfect on my comp but not on another comp so ... i just wanna know how that comes
-
Well, does the "others" have the same file and in the same location on their pc?
-
What is the error message you are getting on the other machines? Paste it here.
-
*in the example i use ren of rename but i also did this with md (make directorie) and this works on my comp but not on another
then i thoughtmayb i must take a directory wich evry one has so i said ill make a map in c:\windows\desktop now this wont work as well so ... it has nothing to do with a certain file that doesnt exists or a directory who doesnt exist
*and about the error it appears that the application just shuts down and that it doesnt give an error
* someone also said why do u prototype system(); =>because if i dont lcc gives an error and then it wont compile