Monday 5 November 2018

c++ - How do we use a abstract class as a function return type?

What's the C++ way of returning a derived type as a abstract type in a function with this caveat?



Say the function creates a derived type and wants to return that object as the abstract base type. How do you do that in C++ without resorting to messy C like pointers?

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...