Thank you for reading this post, first of all.
My problem is that whenever I try to use the following code:
Or, the getline method, it compiles fine, but when I run the program, it dosn't allow the user to enter anything. In other words, the length of the string original is set to zero automatically. When I use the following code:
it works perfectly, but with that method, it cannot have spaces in the input. Here is the code I'm trying to use in cotext:
Thank you for your help and your time.
--Parker Woods
My problem is that whenever I try to use the following code:
Code:
std::getline(cin,original);
Code:
cin >> original
Code:
#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <sstream>
#include <string.h>
#include <fstream>
using namespace std;
int main()
{
string original;
cout << "Please enter in the string:" << endl;
cout << "String: " << endl;
std::getline(cin,original);
cout << "Your String Is: \n\n\n" << endl;
cout << original;
return 0;
}
--Parker Woods
Comment