L
laniik
Hi, I am trying to understand some existing code involving casting
std:
stream (which supposedly compiles, but doesn't seem to on my
compiler)
basically, i want to pass a std:
stream as a void* arguemnt
i have a fn:
bool callback(float percentComplete, void* stream)
{
((ofstream)(&stream))<< percentComplete << "% complete" << endl;
return true;
}
and im using it:
solver.setCompletionCallback(&callback, &cout);
using visual studio .net 2005, i get an error
'type cast' : cannot convert from 'void *' to 'std:
fstream'
is there anyway to make this cast? thanks!
std:
compiler)
basically, i want to pass a std:
i have a fn:
bool callback(float percentComplete, void* stream)
{
((ofstream)(&stream))<< percentComplete << "% complete" << endl;
return true;
}
and im using it:
solver.setCompletionCallback(&callback, &cout);
using visual studio .net 2005, i get an error
'type cast' : cannot convert from 'void *' to 'std:
is there anyway to make this cast? thanks!