to_string

C++

shaozkshaozk cpp/to_string.cpp · 11 行 · 更新于 2026-09-16

#include <iostream>
#include <typeinfo>

using namespace std;

int main() {
  int a = 23;
  string s = to_string(a);
  cout << s << "s type is: " << typeid(s).name() << endl;
  return 0;
}

评论