- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
5 Posted Topics
Hi All, Private data in a class can only be accessed by getter functions. If I have a class as the private data in another class, in another class...Example: class Top { private: class Middle { private: class Bottom { private: int number; } } } If I want to … | |
Hi, I am trying to design a vector within a vector within a vector. For example, a school has 3 floors, each floor has 5 classrooms, each classroom has 20 students, each student has a last name and a first name. I know how to create a vector for floors … | |
Member Access Operators: . and -> http://msdn.microsoft.com/en-us/library/b930c881.aspx I read the above article and played around with some codes. I thought line 25 and 26 would work but they didn't. Can you guys please tell me why? Thanks for helping! #include <iostream> using namespace std; class State { private: int* state; … | |
Can you guys please help me understand when to use const? For example, if I have the following functions: viod add (int* array) { int total = array[1] + array[2]; } viod subtract (int* array); viod times (int* array); viod divide (int* array); viod printArray(int* array); and I only intend … | |
it's a beginner's problem. I am trying to calculate sum of the first 15 factorials. I know int isn't large enough for the sum, so I used unsigned long long but it still didn't work. why?? Thanks for helping! #include <iostream> #include <cmath> #include <iomanip> #include <cstring> using namespace std; … |
The End.