Skip to content

71_cppBeginners.cpp #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 29, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}