How to read a variable from other class that is private

Hi I'm new to c++ and programming.
Here I have a function called copyString.

void copyString(StrType& newString)
{
int count=0;
while(newString.letters[count])
{
newString.letters[count]=letters[count];
}
}
// copyString is a function of class StrType
// and letters[] is a private array
I'm sorry I have found problem here.


the code should be below
void copyString(StrType& newString)
{
int count=0;
while(letters[count])
{
newString.letters[count]=letters[count];
}
}
Topic archived. No new replies allowed.