New course! Every coder should learn Generative AI!
Try a free lesson+ 33
This is true for all function pointers
https://code.sololearn.com/cTPsKeghv011/?ref=app
The reason behind this is that there is no overload of "<<" operator of ofstream to print a function pointer, so it tries to perform type conversion on it and the only type it finds reasonable is Boolean, and as the pointer is not pointing to NULL, a true ( or 1 ) is being printed.