[lug] O-Topic need C++ help......

John Starkey jstarkey at ajstarkey.com
Fri Apr 7 18:12:33 MDT 2000


Thanks. I'm dloading to both boxes right now.

John

On Fri, 7 Apr 2000, PC Drew wrote:

> I'd need more information to really help you, but have you used/learned
> gdb?  That's the GNU debugger.  Basic commands go like this:
> 
> % gdb <program name>
> gdb> break main  <- this sets a breakpoint at the main() function
> gdb> run <any command line args>  <- this actually runs the program
> gdb> n <- this goes to the next line of code, without "stepping" into it.
> When you get to your function, instead of typing "n", type "s" to step
> into the function, then type "n" again.
> 
> I'm sure there's tutorials on gdb online, but that's a crash course!
> 
> --
> PC Drew
> 
> "To understand recursion, we must first understand recursion."
> 
> On Fri, 7 Apr 2000, John Starkey wrote:
> 
> > 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
> > 
> > 
> > _______________________________________________
> > Web Page:  http://lug.boulder.co.us
> > Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> > 
> 
> 
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> 






More information about the LUG mailing list