代码
#include <iostream>
bool remove_file(std::string path){
if (remove(path.c_str())==0){
std::cout << "success!" << std::endl;
}else{
std::cout << "False!" << std::endl;
}
}
int main() {
std::string path = "/home/gsc/Projects/2.txt";
remove_file(path);
return 0;
}