Have you ever see this function:..

This is a discussion on Have you ever see this function:.. within the C++ Programming forums, part of the General Programming Boards category; Code:
int num;
string str1, str2;
num = str1.str2("*") +1;
ok what does this mean............
and why they use it?... ...

Hell if I know. It won't even compile on my system. How do you know that its a function? Wherever you got that information should tell you how its used. You ask how they use it...who's "they"? For that matter, which function are you talking about? I don't see any; you're trying to call str2 like its a member function of str1, when you actually declared it as a string variable in its own right. Where did you get your code fragment and did you test it to see that it actually did anything?

These are good questions to have answered already when you post a vague question.

Assuming this is C++, and you (or sombody) forgot the brackets, and that it works... The function and class have to be defined somewhere else in to code. Maybe in another "included" file.

I don't recognize this as anything from the standard library, but I'm not absolutely sure.

It does seem unusual to have a variable and an object both named str1, and a variable and a function both named str2. Is this legal overloading... I dunno? I think there's something wrong with passing "*" to a function too! (?)