Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The <code>main</code> is not the real entrypoint of the executable, in general the real entrypoint is taken by the runtime library (and in VC++ is definitely like that), which performs some CRT initialization tasks and then calls your <code>main</code>. That value is probably a leftover of one of the function calls performed by the initialization code; the difference between the Debug and Release builds is probably due to different initialization/stack management between the two configurations. By the way, it's just a chance that such vales are always the same, probably they are from some parameter/variable that assumes the same value every time.</p> <p>If it's not like that, it's probably stuff from some other initialization task internal to your process. It's not stuff from other processes or that just "happened" to be at that spot in physical memory, since Windows (on which your application is running) never gives memory pages that belonged to other processes without first blanking them.</p> <p>Still, keep in mind that, as far as the standard is concerned, uninitialized variables have "<em>indeterminate initial value</em>" (§3.3.1 ¶9), so you should not rely on the values you may get by reading uninitialized variables. If you need random numbers, use the appropriate library functions.</p> <hr /> <p>I was forgetting... <code>void main</code> is not valid C++, it should be <code>int main</code> (§3.6.1 ¶2, <em>"It shall have a return type of type <code>int</code>"</em>).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload