Hi everyone. I have a quick question. I'm learning C++ on my windows machine using cygwin's g++.
My question is that my book (c++ primper plus 7th ed.) states that clock_t objects are returned as either long or unsigned long. When I do a typeid(clock_t object).name() I get an "m" returned to me. Can anyone tell me what "m" stands for and if there is an online list of c++ types? I know most of them are easy to identify, i.e. "l" for long and "Pl" for pointer to long, but if I run into more of these unknown letters, I'd like to have a reference.
I have googled "typeid name() list" and searched through these forums but I've come up empty. :(
The name typeid returns isn't standardised, so can be different between environments, and you should expect it to be human readable. Generally speaking, you shouldn't be using typeid at all.
If you want to see what type clock_t is, look up its definition in the header file. It can be different for differenty environments.
Since you are using g++, you can look up gcc's name mangling scheme, or use __cxxabiv1::__cxa_demangle()
declared in <cxxabi.h> to demangle it programmatically.
But kbw's comment is spot on -- don't do this unless you absolutely have to.