Hello! I'm trying to create a function pointer to a member of std::ofstream and get an error. Here's the code:
1 2 3 4 5 6 7 8 9 10
|
int main() {
ofstream bout;
bout.open("bina.dat");
void (*funcp)(const char*, streamsize) = NULL;
funcp = &bout.write();
bout.close();
return 0;
}
|
The error is: "no matching function for call to 'std::basic_ofstream<char>::write()' ." Any ideas?
Last edited on
Learn the syntax
bout.write();
is a call
void (*funcp)(const char*, streamsize)
is not the correct prototype for a member function