Can't see what's wrong with this
Hi all,
I get this error message:
Error E2034 C:\Documents and Settings\alcampo\Escritorio\carlos\nomusic\main.cp p 53: Cannot convert 'char *' to 'char[]' in function viewbio(char *).
This is the function:
Code:
void viewbio(char filename[])
{
char name[] = strcat(filename, ".txt"); //the error is here
ifstream bio(name, ios::in); //open bio
system("cls"); //clear the screen
if(bio.is_open()) //if itīs open
{
while(!bio.eof()) //while itīs not the end of the file
{
char c;
bio.get(c); //read a character...
cout<<c; //and print it to the screen.
}
bio.close();
}
else cout<<"Can't open file "<<name<<". Press any key to continue...";
getch();
}
I've never had any problems with this function untill I tried to compile it this morning.
TIA