Question: I read all the answers from [Does it help GC to null local variables in Java](https://stackoverflow.com/questions/473685/does-it-help-gc-to-null-local-variables-in-java) where everybody agrees that by nullifying a local variable in Java does not help the GC (with some specific exceptions mentioned there). However I refer now not to Java in general, but to an Android app. Moreover, my goal is not merely to "help the GC" but to prevent a possible attacker from getting the value of the local variable before the attacker could ask for a memory dump. (Assuming the attacker has this ability.)

In short, here's my question: is it safer to assign some random value to a local variable in an Android app immediately after the actual value is no longer needed, or is this as safe as relying on GC? Why?

Answer: 
All versions of C++, and C since C99, add an implicit `return 0;` at the end of main before falling off the end.

C89 (which is the default for most compilers) does not, so it is UB if you actually return from main by falling off the end.

Edit: In practice (assuming you are running without sanitizers), this means that you will return whatever happens to be in `$eax` already, i.e. the return value of the last function. Since `printf` usually returns a non-zero value, that is treated as failure.
You forgot the return statement in the end of main indicating success.