-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstring.cpp
More file actions
40 lines (31 loc) · 703 Bytes
/
Copy pathstring.cpp
File metadata and controls
40 lines (31 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include<iostream>
#include<string>
#include<cctype>
using namespace std;
int main()
{
/*char first_name[20];
char last_name[20];
char full_name[50];
char temp[50];
cout<<first_name;
cout<<"Please enter your name \n";
cin>> first_name;
cout<<"Please enter your last_name \n";
cin>> last_name;
cout<<"hello"<<first_name<<" "<<last_name;
strcpy(full_name,first_name);
strcat(full_name," ");
strcat(full_name,last_name);
cout<<"\n your full_name is"<<full_name;
*/
string s1;
string s2 {"Frank"};
string s3 {s2};
string s4 {"Frank",3};
string s5 {s3, 0, 2};
string s6 {3, 'X'};
s1 = "C++ Rocks";
cout<<s1<<endl;
cout<<s1 +" and "+s2;
}