typeid to string c++

C++
#include <string>
#include <typeinfo>
#include <iostream>

using namespace std;

int main(int argc, char** argv) {
    string str = "string";
    cout << typeid(str).name();
    return 0;
}
Source

Also in C++: