Im kind of new in C++. I need to make a program which takes as parameter the name of a file. Then the program should do some operations with the file, and save it with other extension.
I already did the second part, but dont know how to separate the name and extension. What Im doing is this:

void error(char *c1, char *c2="");

void main(int argc, char *argv[])

if(argc !=2) // error validation

ifstream filesource(argv[1], ios::in|ios::binary|ios::nocreate);

if (!filesource) error("Error: No se puede abrir el archivo", argv[1]);

... I dont know how the hell can I split the file name stored in argv[1]. I will appreciate any help.