Klapet wrote:
Quote:
Hi, I'm quite new in C++ programing and I want to ask, if I can handle
events in simple console-like program. For example I need one loop to
repeat until some key is pressed. Is it possible to make?
bool done = false;
char ch;
print_menu();
while( !done && (cin >ch) )
{
switch( ch )
{
case '1': /* Do menu option 1 */ break;
case '2': /* Do menu option 2 */ break;
case '3': /* Do menu option 3 */ break;
case 'Q': done = true; break;
}
print_menu();
}
If you mean without pressing enter, there's no way to do it without
using platform-dependent extensions:
http://www.parashift.com/c++-faq-lit...html#faq-15.17 Quote:
And then I would like to ask, if it is possible to read data from cdrom
over IDE. My intention is, to make a program for PSP (PlayStation
Portable), which could read data from cdrom connected to PSP (don't
know exactly how yet, but frirst of all I need to know, if the program
can be even written). So it would be some kind of file browser. There
is a program called usbhostfs and with this you can acces your HDD in
PC from PSP and do whatever you want with the data from PSP. But the
usbhostfs must be running on the PC, so the PSP's usbhost could somehow
connect to PC usbhostfs (something like connetcting client to server).
So my question is, if it is possible to read data from cdrom without
anything like "usbhostfs server"?
This is an OS-specific question. If you can mount something so you can
open it like a normal file, then sure. Otherwise, you can probably
still do it (there's not much that *can't* be done somehow in C++), but
you're beyond the bounds of standard C++ and thus this newsgroup. See
this FAQ for what is on-topic here and for some other newsgroups you
might consider:
http://www.parashift.com/c++-faq-lit...t.html#faq-5.9
Cheers! --M