[lug] O-Topic need C++ help......
John Starkey
jstarkey at polaris.umuc.edu
Fri Apr 7 14:18:10 MDT 2000
Sorry about the off topic but I can't find any help. I've looked for
mailing lists specific to C++ but there are none that I can find on
several portals and liszt.
I'm doing a simple database for my fiance. I've been taking classes in
intro C++ (I've posted egcs questions here before, if anyone remembers).
Anyway. I'm using
struct JobInfoType
{
.
.
.
char jobDesc[100];
char jobRfrl[100];
}
int main()
{
JobInfoType info;
GetJobInfo //This is in a nested if
}
void GetJobInfo(JobInfoType& info)
{
.
.
.
cout << endl << "Enter today's date (MM DD YYYY): ";
cin >> infoTodayMonth >> infoTodayDay >> infoTodayYear;
cout << endl << "Enter a short job description: ";
cin.getline(info.jobDesc, 100, '\n');
cout << endl << "Enter referral source: ";
cin.getline(info.jobRfrl, 100, '\n');
.
.
.
The problem is that once compiled it will only wait for input for
info.jobRfrl. It shows cout for "Enter job description" but doesn't wait
for cin.
I've tried: several online tutorials, 2 books, 3 - 4 different variations
of the get()'s, and I've compiled it on a server in Maryland (same
response so I know it's not g++'s fault). I'm beating my brain against the
wall. I just need to accept blank spaces in some input (from cin and from
fstream).
For obvious reasons I didn't include all the code, I hope this is enough.
Can anyone help me here or point me in a direction where I can find the
answer.
Many thanks, and once again sorry for the OT,
John
More information about the LUG
mailing list