Quote:
|
Originally Posted by Rotkiv redhead, I'm not questioning your knowledge but rather wanting to tap it:
what's the advantage of using string rather than char? |
In his example he's only allocating room for one single char, not a name consisting of several chars.. Strange things might happen with a program like that, unless the std::cin(char) operator has been modified to dynamicaly allocate whatever is needed. Which i doubt, but I havn't seen the current deffinition of the standard function.
By using string, theres anough room, since string class will dynamicaly allocate space, and there are several usefull features hidden in there aswell.