int* g () {
int j = 2;
return &j;
}
int main () {
using namespace std;
int v = *g();
// assert(v == 2); // Valgrind: Conditional jump or move depends on uninitialised value(s)
}
So, that assert causes a Valgrind error, but I am not too sure what that error means, and why I am not allowed to call assert on that statement.
'v' has been initialized before the assertion, so why is it causing that error?
Thank you in advance.