deleting a file
Actually, now that I have checked the standard, remove is indeed a standard function. My apologies.
This is what i tried
#include
#include
#include
main()
{
if(remove("filename.suffix") == -1)
printf("Couldn''t delete file");
else
printf("deleted");
return(0);
}
i get a linking error
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
and
Debug/temp deleter.exe : fatal error LNK1120: 1 unresolved externals
#include
#include
#include
main()
{
if(remove("filename.suffix") == -1)
printf("Couldn''t delete file");
else
printf("deleted");
return(0);
}
i get a linking error
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
and
Debug/temp deleter.exe : fatal error LNK1120: 1 unresolved externals
BAHcows go moomoos go cow
the includes in the above post were not posted?? anyways i included the following
fstream.h
iostream.h
stdio.h
fstream.h
iostream.h
stdio.h
BAHcows go moomoos go cow
slightlywhacked, you tried to compile this as a w32 graphical app. You'll have to compile as a console app, because the entrypoint for a conapp is 'main' as opposed to 'WinMain' for a gui application. Nevertheless, 'remove' will work in both (you'll only have to include stdio.h for it).
As for changing your directory, use chdir.
Edited by - entrox on November 19, 2000 6:18:21 AM
As for changing your directory, use chdir.
if(chdir("c:\\windows\temp") == -1) printf("Couldn't change directory");else printf("directory changed!");
Edited by - entrox on November 19, 2000 6:18:21 AM
.entrox
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement