//获取文件名后缀 char* fileName = "pwave.sgy"; std::string file_str = fileName; int pos = file_str.rfind('.') + 1; std::string temp = file_str.substr( pos );