Why does typeid.name() return 'random' characters? 😕 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 8

Why does typeid.name() return 'random' characters? 😕

I tried using it in this code 👇 https://code.sololearn.com/c29mUiJEjNFz/?ref=app It only does that on gcc, but works fine on Visual Studio.

28th Aug 2019, 8:50 AM
Moses Odhiambo
Moses Odhiambo - avatar
4 Answers
+ 8
Sonic I've tried to initialize them - doesn't change anything
28th Aug 2019, 1:57 PM
Moses Odhiambo
Moses Odhiambo - avatar
+ 2
I think it's because the letter variable is not initialised and therefore contains garbage/random values.
28th Aug 2019, 1:05 PM
Sonic
Sonic - avatar
+ 1
~ swim ~ nice enlightening explanation
28th Aug 2019, 3:53 PM
Logomonic Learning
Logomonic Learning - avatar