Skip to content

Commit

Permalink
Merge pull request buckyroberts#67 from Collins-a/master
Browse files Browse the repository at this point in the history
71_cppBeginners.cpp
  • Loading branch information
buckyroberts authored Jun 29, 2016
2 parents 12f17a7 + 3d41958 commit 6c13e76
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions C++/71_cppBeginners.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include <iostream>
#include <string.h> //gives you the string functions

using namespace std;

int main(int argc, const char *argv[]){

// string bucky;
// cin >> bucky; //only reads upto the first whitespace
// cout <<"The string I entered is " << bucky << endl;

// string x;
// getline(cin,x); //gets the whole line form input
// cout << x << endl;

// string s1("hampster "); //creating string with constructor
// string s2;
// string s3;
//
// s2=s1;
// s3.assign(s2);
//
// cout << s1 << s2 << s3 << endl;

string s1 = "omgwtfbbq";
cout << s1.at(3) << endl;

for(int x=0;x<s1.length();x++){
cout << s1.at(x);
}

return 0;
}

0 comments on commit 6c13e76

Please sign in to comment.