I'm having a bit of trouble getting string input while i'm in a function. I was wondering how I could input a really long string (about the size of a paragraph).
cin >> entryA seems to work, but only with 1 word. Any more and it starts looping
getline(cin, entryA); doesn't even wait to get keyboard input
int newday()
{
time_t rawtime;
struct tm * timeinfo;
char filename [80];
time ( &rawtime );
timeinfo = localtime ( &rawtime );
strftime (filename,80,"%y%m%d.txt",timeinfo);
ofstream myfile2;
int strlenA, c;
string entryA;
prompts(18);
cin >> entryA; // this is the line i'm having trouble with
strlenA = entryA.length();
char entryB[strlenA];
for (c=0; c<=strlenA; c++)
{
entryB[c] = entryA[c];
}
encrypt(entryB);
}
I would appreciate any help, thank you.