We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 12f17a7 commit 3d41958Copy full SHA for 3d41958
C++/71_cppBeginners.cpp
@@ -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