Last active
December 14, 2015 10:09
-
-
Save JesseHerrick/5069891 to your computer and use it in GitHub Desktop.
Use a string to define then use a variable. No more arrays!!!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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