Skip to content

Instantly share code, notes, and snippets.

@Keith-S-Thompson
Last active August 27, 2016 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Keith-S-Thompson/20afe1c284747fe33155c47e67e4245f to your computer and use it in GitHub Desktop.
Save Keith-S-Thompson/20afe1c284747fe33155c47e67e4245f to your computer and use it in GitHub Desktop.
"Array ints not returning correctly"
#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);
}
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