I Mean even if it is not understandable. For example if int is 32432423423403095590353095309530953, then its always gonna be same. So i can easily set a function to return what type the variable is...
The results you're getting already fulfill that. Perhaps it would help to explain how exactly the C++ implementation you're using gets the strings you're seeing.
g++ implements typeid(...).name()
such that it returns the "ABI mangled" name of the type. This is a special way of representing types that is used in compiled object files and libraries. If you compile C++ code into assembly you'll see "symbols" that identify what function or data the resulting assembly code is related to. For example, take the function:
int foo(double a, char b) {
return a + b;
}
compile it to assembly, and you'll see something like the following:
_Z3foodc:
.LFB0:
.cfi_startproc
movsbl %dil, %edi
cvtsi2sd %edi, %xmm1
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
ret
.cfi_endproc
The first line here is the 'mangled' symbol that is used to identify the function int foo(double,char)
. It contains "Z3foo" that represents the function name, and then 'd' that represents the type of the first argument and 'c' that represents the type of the second argument. This symbol is used to identify the function in the binary object file, in library indices, by other compiled objects that want to link to this function, etc.
You can also demangle symbols using the c++filt tool. This tool scans through any text you pass it looking for things that conform to the mangling syntax, and converts them into something more like the way those types are named in C++ source code.
g++ implements the Itanium C++ ABI mangling scheme. It's used by most unix platform compilers.
So, back to your code, guess how the type 'int' is represented in these symbols.
The Itanium ABI specifies an additional function for demangling. Here's an example using it.