* xemacs, gdb, I can't input from the terminal in main function, but others functions well.
@ 2005-09-08 10:33 davinci
0 siblings, 0 replies; only message in thread
From: davinci @ 2005-09-08 10:33 UTC (permalink / raw)
I had study it for a long time .but I didn't solve it .Ihad read
<<Debuging with GDB>>
But I didn't get something useful.
include<iostream>
#include<cstdlib>
using std::isdigit;
int main()
{ int i=4;
try
{
while(1)
{
std::cin>>i;
if(!isdigit(i))
{
std::cout<<"not digit ,once more"<<std::endl;
std::cout<<"i="<<i<<std::endl;
}
if(i==2)
{
std::cout<<"good boy"<<std::endl;
}
else
{
std::cout<<"bad boy"<<std::endl;
}
}
}
catch(...)
{
std::cout<<"execption had happened"<<std::endl;
}
}
//end of the codes
//from here: std::cin>>i;
(gdb) s //here ,no chance to input anything.
(gdb) s
(gdb) s
not digit ,once more
(gdb) s
i=4
(gdb) s
(gdb) s
bad boy
(gdb) s //no chance to input anything,there is no prompt for input.
(gdb) s
(gdb) s
not digit ,once more
(gdb) s
i=4
(gdb)
But I can input something when I am no in the main function.
anyhelp?
thanks very much.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-09-08 10:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-08 10:33 xemacs, gdb, I can't input from the terminal in main function, but others functions well davinci
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).