Hi guys, Can anybody help me in this kind of error?..I'm actually reading a file text and I'm trying to save the string in some variable but I cannot save it because of this error,what is the solution for this..Her is my code:
infile.getline(STRING,10,':'); // Saves the line in STRING.
tmpST.id=STRING;//(where the error occurs)
cout<<STRING<<endl; // Prints our STRING.
You can't use the assignment operator like that with C - style strings. If you want the variable tmpST.id to be set to the value of STRING use the function strcpy( destination , source ).
strcpy( tmpST.id, STRING ).
This will copy the contents of STRING into tempST.id