CPP   31

strings arrays

Guest on 20th April 2022 02:04:53 AM

  1. // For C++ libraries.
  2. #include <iostream>
  3. // Library for strings.
  4. #include<string>
  5. using namespace std;
  6.  
  7. int main() {
  8.     string word="Book";
  9.  
  10.     cout << word << endl;
  11.     word[1]='i';
  12.     word[2]='k';
  13.     word[3]='e';
  14.     cout << word << endl;
  15.     return 0;
  16.  
  17. }

Raw Paste


Login or Register to edit or fork this paste. It's free.