+ 5
Uninitialized variables in C++ quizzes
Hi, I've seen some C++ quizzes on SoloLearn which I think, IMHO, deliberately assume uninitialized variables or memory in general is all zeroed. This is not true and very compiler/platform dependent. Not only I found it quite frustrating to get wrong answers in the quizzes but I also think this is somehow misleading, and most importantly, a very bad practice to make this assumption. I'd be glad to get your thoughts about this. Cheers, Mathieu
2 Antworten
+ 2
yes there is something wrong
0
Yeah, you're right: uninitialised variables will contain whatever was at the memory address previously. Which value could be anything!