0
Why is random value printed?
https://code.sololearn.com/cRwp3Whsnh9K/?ref=app in line 11 random value for extra placeholder. Shouldn't it be 0.
5 Answers
+ 2
well this behavior is unpredictable, you may get random value for %f on some other machine, some compilers may give you warning, you never know
+ 2
When a function is called, the arguments are placed on the stack.
Put 2, and took 3.
The third item on the stack already exists. The stack is large and is used by all functions.
The additional item MUST be random.
Riddle - why '%f' is not random?
+ 1
it doesn't work that way, if you use %d you must specify a corresponding variable
0
yes. but if I don't you should get a 0. just like for %f you get 0.000000
0
Sev Divov try c compiler for android,
your array will never be out of index and any call to undeclared variables will return error or (mostly) zero. So it's really upto compiler settings and design.