頭文件:#include <stdio.h> //C
#include <cstdio> //C++
函數原型:int remove(const char * filename);
返回結果:如果成功返回 0,失敗返回“EOF”( -1)。
1 #include<iostream> 2 #include<cstdio> 3 4 using namespace std; 5 6 int main() 7 { 8 char *savePath = "/home/zhuwei/contour/linearIteration.shp"; 9 10 if(remove(savePath)==0) 11 { 12 cout<<"刪除成功"<<endl; 13 } 14 else 15 { 16 cout<<"刪除失敗"<<endl; 17 } 18 return 0; 19 }