I have a class that has a private member char *buf which is basically a
pointer to a string.
I have a member function called print(); which consists of
void String::print()
{
cout << name;
cout << ":\t\"";
cout << buf;
cout << "\"\t" << length << " characters"<< endl;
}
But the cout << buf prints out maybe half of the string. When gives a weird
symbol (usually a Spades symbol), and then continues on it's merry way. But
if I use the debugger (Visual Studio 2002) it prints correctly.
pointer to a string.
I have a member function called print(); which consists of
void String::print()
{
cout << name;
cout << ":\t\"";
cout << buf;
cout << "\"\t" << length << " characters"<< endl;
}
But the cout << buf prints out maybe half of the string. When gives a weird
symbol (usually a Spades symbol), and then continues on it's merry way. But
if I use the debugger (Visual Studio 2002) it prints correctly.
Comment