I am trying to overload istream >> using char*. Please take a look at the code below and try to complete the function containing the operator>>, I could not do it. Thanks
You haven't even tried. We aren't going to do your homework for you -- especially for simple problems like this.
See if you can write a function that reads a full name using just cin. Once done, you know how to read the full name from the input stream.
By the way, your class is misnamed: it is not a stream -- it is a person's name. It should be something like one of the following: class PersonsNameclass FullNameclass Person
etc.
The name of your class should reflect the nature or purpose for which it exists.
I've been shooting arrows today on my archery range. I could call the arrows "cars", then tell people I've been shooting cars today, but that would confuse people and I would not likely be happy with the consequences.
I've been shooting arrows today on my archery range. I could call the arrows "cars", then tell people I've been shooting cars today, but that would confuse people and I would not likely be happy with the consequences.
^this = win
Please do name your classes correctly, in BOTH areas...e.g.:
1 2 3 4 5
class Car { //instead of person = FAIL
//...
}
Car Apple; //also = FAIL
I appreciate the comments, I really take it seriously, because I know you guys are very experienced. As far as classes names, I have written a bunch of them and I name it according to the item I am learning. The "stream" for example, is only for my reference, this is a class I built for learning iostream operator overload. Thank you guys again, I am learning C++ by myself and you are the only ones I am able to ask for help!! I am trying to follow Duoas advice, I will put here the result as soon as I have it!!