Hello everyone I'm having trouble writing part of a vector to a file. I'm getting this error:
main.cpp:287: error: cannot convert `std::basic_string<char, std::char_traits<char>, std::allocator<char> >' to `const char*' for argument `2' to `int fprintf(FILE*, const char*, ...)'
This is part of my code:
ListViewTextItem.begin();
FILE * pFile;
pFile = fopen ("myfile.txt","w");
for( int i = 0; i < ListViewTextItem.size(); i++ ) {
fprintf(pFile, ListViewTextItem[i] );
}
fclose (pFile);
What's the problem with and how do I fix it???