include

using namespace std;
class B
{
public:
B() = default;
B(int b) :a(b) {};
private:
int a;
};
enum class color { red = 1, yellow = 5, green = 9 };
int main()
{
int a = 42;
string b = “555”;
double c = 5.4444;
float q = 5.33;
B e();
color r = color::red;
cout << typeid(a).name() << endl
<< typeid(b).name() << endl
<< typeid(c).name() << endl
<< typeid(e).name() << endl
<< typeid(r).name() << endl
<< typeid(q).name() << endl;
system(“pause”);
return 0;
}
c++ typeid对多种类型名称的输出

相关文章:

  • 2021-06-15
  • 2021-12-19
  • 2021-09-02
  • 2022-12-23
  • 2022-12-23
  • 2021-10-26
  • 2022-12-23
  • 2021-07-14
猜你喜欢
  • 2022-02-25
  • 2021-05-18
  • 2022-12-23
  • 2021-06-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案