Do the overloaded operators count as functions, and should I simplify those? I am at a design dilemma here:
1)With my old code, inside my main() function I implicitly read-out the final results by invoking r to the overloaded ostream operator. if I take out the essentials out of that operator, my class will not let me access my data I manipulated without a function. In this case, should I create two more functions (or one) which will display my stats, and if so, doesn't that nullify the existence of my overloaded operators? (i'm using the template red provided)
By the way, I'm still working on this example, I'm just trying to re-read over the chapter on pointers, and string types as I still haven't quite figured out how the last example worked (I understand the logic part but can't trace it onto code, mainly the remove function out of the previous thread that redhead was so kind as to rework for me).
Quick question: I've read that the following type of declaration is legal:
Code:
#include <iostream>
void displaythem(int ival, int *pi, int **ppi){std::cout << ival << *pi << **ppi;};
main()
{
int ival = 1024;
int *pi = &ival;
int **ppi = π
displaythem(ival,pi,ppi); //here we send pi and ppi as to not de-reference them
}
In this simple example, I can perform the operations of pointing to a pointer, and then de-referencing them as to obtain the initial value of ival with all three instances, but when would you need a pointer to a pointer in a programming scenario, which couldn't be achieved (more efficiently) by other means?