- Win32API質問箱 Build122
208 :デフォルトの名無しさん[sage]:2016/04/23(土) 07:51:54.45 ID:1OvIZwV0 - using std::string;
string get_file_prefix(const std::string& filename) { string temp(filename); string::size_type pos = temp.find_last_of("."); if (pos != string::npos) { temp = temp.substr(0, pos); } pos = temp.find_last_of("/\\"); if (pos != string::npos) { temp = temp.substr(pos + 1); } return temp; } ex) string in_filename(argv[1]); string prefix = get_file_prefix(in_filename);
|