#include using namespace std; void mLoad(char *name) { char *ext; ext = strstr( name , "." ); if( ext == ".bmp" ) cout << "bmp"; if( ext == ".jpg" ) cout << "jpg"; } int main() { mLoad( "112.bmp" ); cin.get(); cin.get(); }