Advertisement
Felanpro

Index Locator String

Dec 5th, 2015
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     string randomText = "Hello, what's going on?";
  8.  
  9.     cout << randomText << endl;
  10.  
  11.     int findInText = randomText.find("going", 0);
  12.  
  13.     cout << "Location for beginning of the word going, starts on line " << findInText << endl;
  14.  
  15.     system("pause");
  16.    
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement