Re: help



osmium wrote, On 09/05/07 16:23:
"Richard Bos" writes:

"osmium" <r124c4u102@xxxxxxxxxxx> wrote:

"i" writes:

I want to display two answers .When i press the Enter key first
answer should be displayed and few seconds later the second answer
should be displayed. How can i do it?
You can create short delays by using the clock() function, see <time.h>.
You can, but you shouldn't. If you do this on a multi-user system, you
risk getting banned by the sysadmin for hogging the CPU. A much better
solution is to use a system-specific function for this more or less
system-specific problem; ask in a newsgroup that deals with the OS
and/or compiler you're using, and see also (as usual!) the FAQ:
<http://c-faq.com/osdep/subsecond.html>.

The code posted by the OP suggested, to me, a beginning coder - very likely a student.

There are two possible answers that survive the very vigilant net nannies on this NG.
o A C way
o You can't do that in standard C.

I thought the first approach was more helpful, considering who was asking the question.

I would be mildly surprised if the instructor did not expect the OP to use a delay/sleep/wait type function provided by the implementation rather than a loop, so I would consider Richard's suggestion to be more helpful. It is especially helpful as if the instructor is good the OP might even get some bonus points for saying that it is a system specific solution.

> You approach would not only be more difficult for the OP to
use but it violates the net nannies threshold for NG abuse.

Saying you should (or can only) do something using a system specific method and saying where to go to find the solution does not as far as I've seen upset even the strictest interpreters of this groups purpose. It is when the discussion is not redirected to an appropriate place that the complaints start.
--
Flash Gordon
.



Relevant Pages

  • Re: Decisions, Decisions, Decisions ????
    ... >>> There also is a saying that if you don't have something nice to say ... > to another instructor. ... your macho attitude from the way I understand your writing, ... So if I say Dudley let me get instruction from you ...
    (rec.aviation.student)
  • Re: Decisions, Decisions, Decisions ????
    ... >> There also is a saying that if you don't have something nice to say then ... > place - rather than worry about 'risking' embarrassing the pilot. ... > something - I would much rather have my safety (and the safety of my ... to another instructor. ...
    (rec.aviation.student)
  • Re: CFI Checkride date finally nears.......
    ... What I was saying was that the instructor has to teach the student ... everything they will have to know to SOLO in a few short hours. ...
    (rec.aviation.student)
  • Re: CFI Checkride date finally nears.......
    ... What I was saying was that the instructor has to teach the ... I prefer to think of this as my superior intelligence and intellect. ...
    (rec.aviation.student)
  • Re: CFI Checkride date finally nears.......
    ... What I was saying was that the instructor has to teach the ... student everything they will have to know to SOLO in a few short hours. ...
    (rec.aviation.student)