Could use some help i am having some hard time figuring this out. What i need to do is read in a file and then based on its file extension decide what to do i.e. ".cpp" or ".html"
I though i could just read in the file name then the extension but was not allowed. lol So any help would be appricated here is my code so far for the file input.
Im pretty sure this could be done with strings?
Code:#include <iostream> #include <string> #include <fstream> using namespace std; char* filename; ... int main () { ... cout <<"Please enter the name of the file" << endl; filename=new char; cin >> filename; ... }