Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: won't compile?

21 views
Skip to first unread message

Geoff

unread,
Apr 3, 2015, 12:54:39 AM4/3/15
to
On Thu, 2 Apr 2015 20:53:36 -0700 (PDT), SpreadTooThin
<bjobr...@gmail.com> wrote:

>void searchout(void) {
>
> string l, t;
> for (std::vector<string>::iterator it = logLines.begin() ; it != logLines.end(); ++it) {
> for (std::vector<string>::iterator thrd = threadIds.begin() ; thrd != threadIds.end(); ++thrd) {
> l = *it;
> t = *thrd;
> if (l.substr(t) != string::npos) { // Something is wrong here?
>
> }
> }
> }
>}
>
>what is wrong with this if statement? l.substr(t) compiler doesn't like it.

What is the error message from your compiler?

Hint: The member substr takes two arguments, what have you given it?

Barry Schwarz

unread,
Apr 3, 2015, 3:26:00 AM4/3/15
to
On Thu, 02 Apr 2015 21:54:23 -0700, Geoff <ge...@invalid.invalid>
wrote:
Both arguments of substr have default values if they are omitted from
the function call.

--
Remove del for email
0 new messages