Skip to Content
C++ How to Program, 10/e
book

C++ How to Program, 10/e

by Paul Deitel, Harvey Deitel
February 2016
Beginner
1080 pages
207h 57m
English
Pearson
Content preview from C++ How to Program, 10/e
... 41     cout << "\nfind_first_not_of(\"noon is 12 pm; midnight is not.\")"
42        << " returned: " << location << endl;
43  }

Original string:
noon is 12 pm; midnight is not.

(find) "is" was found at: 5
(rfind) "is" was found at: 24

(find_first_of) found 'o' from the group "misop" at: 1

(find_last_of) found 'o' from the group "misop" at: 28

(find_first_not_of) '1' is not contained in "noi spm" and was found at: 8

(find_first_not_of) '.' is not contained in "12noi spm" and was found at: 13

find_first_not_of("noon is 12 pm; midnight is not.") returned: -1

String string1 is declared and initialized in line 8. Line 13 attempts to find "is" in string1 using function find. If "is" is found, the subscript of the starting location of that string is returned. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C++ How to Program, Sixth Edition

C++ How to Program, Sixth Edition

P. J. Deitel - Deitel & Associates, Inc., H. M. Deitel - Deitel & Associates, Inc.
C++ How to Program, Ninth Edition

C++ How to Program, Ninth Edition

Paul Deitel, Harvey Deitel

Publisher Resources

ISBN: 9780134448930Purchase book