I don't understand why my integer values are changing in C++

74 Views Asked by At

My code is the following (C++) and returns 0, 8, and then 0 for each integer. I have no idea why?

#include <iostream>

int main(){

int earth;
std::cout << earth << '\n';

int fire;
std::cout << fire << '\n';

int water;
std::cout << water;

return 0;
}

I expected all 3 int values to return 0.

0

There are 0 best solutions below