Hi, my name is Ricardo (I am gonna soon introduce myself properly in this forum). I am new to C++ and object oriented programming and having some sort of trouble working with "vectors".
My program has a class of "Accounts", a class of "Database", a class of "Adding" and some other classes that doesn´t matter right now - maybe in next questions
. My class Database extracts info from a ".txt" with each row of the file corresponding to an "Account" object and each column of each row corresponding to a data-member (I am brazilian and have know idea how to say that in English, they are kind of the properties of the object)- and so far so good. Then I put all the objects in a vector<Accounts>.
The problem is when I have to pass this vector to the Excluding class. I do that by reference. And here is the question: "By passing by ref, am I not hurting the principle of protecting the private data from the class ? " And: " is there any other way to do that without being by ref ? "
Thanks for everybody who helps.
Att,
Ricardo S.
My program has a class of "Accounts", a class of "Database", a class of "Adding" and some other classes that doesn´t matter right now - maybe in next questions
The problem is when I have to pass this vector to the Excluding class. I do that by reference. And here is the question: "By passing by ref, am I not hurting the principle of protecting the private data from the class ? " And: " is there any other way to do that without being by ref ? "
Thanks for everybody who helps.
Att,
Ricardo S.