Skip to content

Commit 3d41958

Browse files
committed
71_cppBeginners.cpp
1 parent 12f17a7 commit 3d41958

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Diff for: C++/71_cppBeginners.cpp

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
}

0 commit comments

Comments
 (0)