Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ get filename from path

// get filename
std::string base_filename = full_path.substr(full_path.find_last_of("/") + 1);

// remove extension from filename
std::string::size_type const p(base_filename.find_last_of('.'));
std::string file_without_extension = base_filename.substr(0, p);
 
PREVIOUS NEXT
Tagged: #filename #path
ADD COMMENT
Topic
Name
3+5 =