Download
c programming chapter 5 string n.
Skip this Video
Loading SlideShow in 5 Seconds..
C++ Programming: chapter 5 – string PowerPoint Presentation
Download Presentation
C++ Programming: chapter 5 – string

C++ Programming: chapter 5 – string

119 Vues Download Presentation
Télécharger la présentation

C++ Programming: chapter 5 – string

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. C++ Programming: chapter 5 – string 2014, Spring Pusan National University Ki-Joune Li http://isel.cs.pnu.edu/~lik

  2. #include <iostream> #include <string> using namespace std; int main() { string s1(“abcd”); string s2=“bcde”; string *s3=new string(s1); string s4=s1+”, “+s2; string s5,s6,s7; getline(cin,s5) >> s6; // return type of getline is reference of the first parameter getline(cin,s7, ‘+’); // ‘+’ is used as a delimiter cout << s4.length(); cout << s1[3] << s1.at(3); cout << s1.find(“cd”); } stringclass