Hi,
I m working on a console MP3 player using the FMOD Sound Library. In this library, the function to open an MP3 file has this signature:
FSOUND_Stream_OpenFile(const char *filename);
In my MP3 player, I would like the user to be able to input the filepath and name of the song he/she wants to play, and the Player to open the respective song.
I thought the code could look like this:
//...
char PathInput[30];
cout << "Please enter the name of the song (incl. path) you want to open." << endl;
cin.getline(PathInput, 30);
FSOUND_Stream_OpenFile(PathInput);
//...
However, this code does not work, since the function needs a const char*, and not a char*. Is there anyway of casting the char* to a const char*, i.e. making the compiler think that what it is passing in to FSOUND_Stream_OpenFile is a const char*?
If this isn't possible, is there a way of converting the char* to a const char*?
Any help or suggestion is greatly appreciated!!!
MCMalayalam