Scan input - But only if something has been typed

M

macuser55

Hello all,

I would like to do a simple input scan from the command line, but only if
the user has typed something...

I have had a look at the select() method, but am still having trouble.

Basically, I want to treat stdin as a textField. Having a GUI would solve
this problem of course, but a gui is not required, and I'm after an easier
way.

Ta

Chris
 
M

Mark A. Odell

Hello all,

I would like to do a simple input scan from the command line, but only
if the user has typed something...

Please read the C-FAQ.
I have had a look at the select() method, but am still having trouble.

Of course, select() not being part of ISO C.
Basically, I want to treat stdin as a textField. Having a GUI would
solve this problem of course, but a gui is not required, and I'm after
an easier way.

Then you are off to the land of the Platform-specific. ISO C cannot do
what you require.
 
A

Artie Gold

macuser55 said:
Hello all,

I would like to do a simple input scan from the command line, but only if
the user has typed something...

I have had a look at the select() method, but am still having trouble.

Basically, I want to treat stdin as a textField. Having a GUI would solve
this problem of course, but a gui is not required, and I'm after an easier
way.
Alas, there's no way to do this in ISO standard C; you'll need platform
specific extensions.

HTH,
--ag

[If you are, in fact, a Mac user (running some flavor of OS X)
news:comp.unix.programmer may be an appropriate place to ask.]
 
D

Dan Pop

In said:
Ta guys, I'll shoddy it up with a GUI.

No need to do that: if your code need not be portable, there are
system specific solutions that are, usually, much simpler than
throwing in a GUI.

Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top