Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*String Operations
- string x = "Hello";
- int length = x.size();
- //Prints the length of the word "Hello" in numbers/digits.
- cout << length;
- system("pause");
- */
- /*String Operations
- string x = "Hello";
- char firstCharacterVariable = x.at(4);
- //Prints the character depending on what number is typed in char firstCharacterVariable.
- //In this case (4) will print the character "o" of Hello.
- //Think like this: "H e l l o"
- // 0 1 2 3 4 , always start with 0.
- cout << firstCharacterVariable << endl;
- system("pause");
- */
- /*String Operations
- string x = "Hello";
- int length = x.length();
- //Also prints the length of the word "Hello" in numbers/digits as well does x.size.
- cout << length << endl;
- system("pause");
- */
Advertisement
Add Comment
Please, Sign In to add comment