1. Source codes: FolderUtility.h TestFolder.c
//=========================================
//FolderUtility.h part of the source
#include
#include
#include
using namespace std;
void CreateDir(char* path)
{
........
}
........
//==========================================
//TestFolder.c
#include "FolderUtility.h"
#include
int main(void)
{
CreateDir("./sub1/sub2");
EmptyDirectory("./sub1");
printf("Finished.\n");
return 0;
}
At first, I use the command: cl /GX TestFolder.c, but it did not work and pops up some errors.
2. Rename the file "TestFolder.c" to "TestFolder.cpp". Reuse the compiling command again, it works... This proves that the cl compiler will use the postfix of the filename to judge something in the process.
p.s.: /GX means enabling C++ exception handling;
I am not familier with the cl compiler, so there is a lot of things to dig if I want to use it professionally.
No comments:
Post a Comment