class info
{
private:
string name;
public:
info()
{
string info.setname(string name);
void info.getname();
cout << "Your name is: " << name;
}
};
int main()
{
info one;
info two;
return 0;
}
Also, can classes see how other classes are implemented?
So there are two copies? Darn, I thought it was only one!
Sorry, this is confusing for me as well!
Classes usually don't know how other classes are implemented, right? I'm looking at a question on my homework here, the question is:
Classes do not have the property of _____.
a. encapsulating data
b. information hiding
c. containing both data and functions
d. usually knowing how other classes are implemented
By process of elimination I'm absolutely sure that classes can encapsulate data, use information hiding, and can contain both data and functions. But I'm curious if maybe I was wrong. Do classes know how other classes are implemented?
In your example info class, I'm not sure why you would want name to be static.
Presumably info contains information about a person, or student, or such. If that assumption is correct, then you would not want name to be static, since each person would have a different name.