Skip to content

Instantly share code, notes, and snippets.

@JesseHerrick
Last active December 14, 2015 10:09
Show Gist options
  • Save JesseHerrick/5069891 to your computer and use it in GitHub Desktop.
Save JesseHerrick/5069891 to your computer and use it in GitHub Desktop.
Use a string to define then use a variable. No more arrays!!!
#include <iostream>
#include <string> //this is important in defining the string
using namespace std;
int main()
{
string myStringVariable
cout<< "Type your string: ";
cin<< myStringVariable;
cin.ignore();
cout<< "Your string is " << myStringVariable << ".";
cin.get()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment