语言

Menu
Sites
Language
result Tizen::Base::String::IndexOf ( const String & str, int startIndex, int & indexOf ) const

Can't seem to get String.IndexOf() to work.  Compiler keeps saying "no matching member function for call to 'IndexOf'"  

Here's the definition from the documentation: 

result Tizen::Base::String::IndexOf    (    const String &     str, int     startIndex, int &     indexOf  )         const

here's the code i'm trying: 

 

int i;

const String string1 = "abcdefg";

const String string2 = "bcd";

string1.IndexOf(&string2, 0, &i);

 

响应

2 回复
Alex Dem

Hi,
It should works, please remove the & operator which takes adress from method call:
string1.IndexOf(string2 0, i);
Alexey.

Nick Hathaway

Oh that works!  string1.IndexOf(string2, 0, i), with no address-of operators

 

Thanks