Can we have a static virtual functions? If not, then WHY? [duplicate]

No, because it doesn’t make any sense in C++.

Virtual functions are invoked when you have a pointer/reference to an instance of a class. Static functions aren’t tied to a particular instance, they’re tied to a class. C++ doesn’t have pointers-to-class, so there is no scenario in which you could invoke a static function virtually.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)