Newbie problem with the String class

Martin Wiebusch marwie at gmx.net
Wed Feb 9 19:32:32 GMT 2000


Bernd Gehrmann wrote:
> 
> On Wed, 9 Feb 2000, Martin Wiebusch wrote:
> > Ok, this works, but anyway, I can't create any instances of the String
> > class. I tried this:
> 
> String is an obsolete class from the libg++ library.
> Use string instead.
Thanx, that works. But now I've got another problem. I read in the
Documentation for C/C++ that the string class has a method called
"index" for finding the position of a character or substring. I wanted
to use that, but the line

pos = s.index("abc");

produced this error message

no matching function for call to 'string::index(char[4])'

I searched in "/usr/include/g++/std/bastring.h" for "index": no hits.
But it seems that the index method is defined in "String.h". Anyway,
including that one didn't help either.

Was "index" replaced by another method? Which one? Help!!




More information about the KDevelop mailing list