Thursday, December 30, 2010

C++ Strings

Intro to strings this morning

#include iostream

using namespace std;

int main () {

char buffer[10];

cout << "Type some text and shit" << endl;
//hold space for the null character
cin.getline(buffer,9);

cout << "You typed : " << buffer << endl;

return 0;


}

No comments:

Post a Comment