判断对象类型用typeid(),想要输出类型用typied(a).name(),其头文件为#include <typeinfo>;

如下图所示(建议可以了解typied      可看下此博文https://blog.csdn.net/zkybeck_ck/article/details/51762541):

 

C++判断对象类型

 

相关文章:

  • 2021-12-10
  • 2021-12-11
  • 2021-12-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-20
  • 2022-01-03
  • 2021-09-29
  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案