strings defined using array and pointer notation : Your string « Data Types « C++ Tutorial






#include <iostream>  
  using namespace std;  
    
  int main(){  
     char str1[] = "Defined as an array";  
     char* str2 = "Defined as a pointer";  
    
     cout << str1 << endl; 
     cout << str2 << endl;  
    
     str2++;   
    
     cout << str2 << endl; 
     return 0;  
  }








2.42.Your string
2.42.1.Your own string class
2.42.2.Define and use a string class
2.42.3.convert between ordinary strings and class String
2.42.4.strings defined using array and pointer notation