When using a string object, you can set the object equal to a string literal. How is this possible? The object consists of multiple functions and variables, so how can you just set it equal to one string literal?
Thanks!
Edit:
Sorry for the confusing question.
It makes sense to me that you can set a variable or array equal to a value. For example:
char word[3] = {'c', 'a', 'r'};
But a string is not simply a variable, so what in its class allows you to write a statement setting the object to a value?
string word = "car";
I would love to do this in my objects, but thus far I have been using something like this, where objectTemp is the class & tempF is a member holding the temperature value in Fahrenheit:
objectTemp cat;
cat.tempF = 102;