MCPcopy Create free account
hub / github.com/Apress/beginning-cpp20 / main

Function main

Examples/NoModules/Chapter 07/Ex7_04.cpp:5–13  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include <string>
4
5int main()
6{
7 std::string sentence {"Manners maketh man"};
8 std::string word {"man"};
9 std::cout << sentence.find(word) << std::endl; // Outputs 15
10 std::cout << sentence.find("Ma") << std::endl; // Outputs 0
11 std::cout << sentence.find('k') << std::endl; // Outputs 10
12 std::cout << sentence.find('x') << std::endl; // Outputs std::string::npos
13}

Callers

nothing calls this directly

Calls 1

findMethod · 0.45

Tested by

no test coverage detected