The iteration in nickels is only "remembered" in the function. When I access change.nickels elsewhere its back to its original pre-2000 value. Reading on structs mentioned that the beauty of structs was one of only a few ways for a function to return more than one var. What can I do to change it in the function block to carry on outside it as well.--> Note if I do change the nickel value in the int main()... it "sticks through out the program.!
looks pretty close to classes to me -- I'll study it, thx for sample.
generally why srtuct rather than classes, vice versa? struct seems pretty agile
Experimented w/ it a bit
using structs with member fx's reduces the number of struct defs and organizes them better w/ increased inter-relatedness & readability
generally why srtuct rather than classes, vice versa? struct seems pretty agile
Yes, structs and classes are nearly identical. The only difference is the default visibility of members. With structs, members are by default public. With classes, the default is private.
I like to use structs with dealing with POD (Plain Old Data) and classes when dealing with OO.
That's a somewhat arbitrary distinction though, as you can represent POD with a class and OO with a struct.
In C++, struct and class are synonyms. The only difference is the default privacy (structs default to public, classes default to private). Other than that, they're identical.