File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include < iostream>
2
+ #include < string.h> // gives you the string functions
3
+
4
+ using namespace std ;
5
+
6
+ int main (int argc, const char *argv[]){
7
+
8
+ // string bucky;
9
+ // cin >> bucky; //only reads upto the first whitespace
10
+ // cout <<"The string I entered is " << bucky << endl;
11
+
12
+ // string x;
13
+ // getline(cin,x); //gets the whole line form input
14
+ // cout << x << endl;
15
+
16
+ // string s1("hampster "); //creating string with constructor
17
+ // string s2;
18
+ // string s3;
19
+ //
20
+ // s2=s1;
21
+ // s3.assign(s2);
22
+ //
23
+ // cout << s1 << s2 << s3 << endl;
24
+
25
+ string s1 = " omgwtfbbq" ;
26
+ cout << s1.at (3 ) << endl;
27
+
28
+ for (int x=0 ;x<s1.length ();x++){
29
+ cout << s1.at (x);
30
+ }
31
+
32
+ return 0 ;
33
+ }
You can’t perform that action at this time.
0 commit comments