Sample program for http://stackoverflow.com/q/39184749/827263
Last active
August 27, 2016 21:35
-
-
Save Keith-S-Thompson/20afe1c284747fe33155c47e67e4245f to your computer and use it in GitHub Desktop.
"Array ints not returning correctly"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
class Value{ | |
public: | |
int values[8] = { }; | |
Value(); | |
~Value(); | |
}; | |
Value::Value(){} | |
Value::~Value(){} | |
int main() { | |
char dummy; | |
Value value; | |
for (int i = 0; i < 8; ++i) { | |
std::cout << "value.values[" << i << "] = " << value.values[i] << "\n"; | |
} | |
std::cout << "Press <return> to continue\n"; | |
std::cin.read(&dummy, 1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
value.values[0] = 0 | |
value.values[1] = 0 | |
value.values[2] = 0 | |
value.values[3] = 0 | |
value.values[4] = 0 | |
value.values[5] = 0 | |
value.values[6] = 0 | |
value.values[7] = 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment