1#include <iostream>
2#include <string>
3using namespace std;
4
5string GetFileExtension(string Filename)
6{
7 size_t LastDot = Filename.find_last_of(".");
8
9 if (LastDot == string::npos)
10 {
11 return ""; // No extension in Filename string
12 }
13
14 return Filename.substr(LastDot);
15}
1All C++ header extensions: .c , .h , .hpp , .hxx , .cpp , .hh
2C++ file (items / source code): .cpp , .cc , .cxx
3