www.digitalmars.com         C & C++   DMDScript  

D - getch ()

reply Karl Bochert <kbochert ix.netcom.com> writes:
Two questions:
1) When I try to hold a dos box open with 'getch ();' I get the error
    message 'E"\dmd\src\phobos\stdio.d(142) getch function parameters do not
match argument types ()'
   I must be doing something stupid?.

2)) Is there any reason D can't have a getch() that does what it says, as
opposed to
'get_first_char_of_line()' ?   It can be done, and part of the rationale for D
is to
correct C's flaws.

Karl Bochert
Jan 08 2002
next sibling parent "Walter" <walter digitalmars.com> writes:
Actually, D doesn't have a getch(). It just calls the C one directly. Are
you passing an argument to getch()?

"Karl Bochert" <kbochert ix.netcom.com> wrote in message
news:1103_1010544653 bose...
 Two questions:
 1) When I try to hold a dos box open with 'getch ();' I get the error
     message 'E"\dmd\src\phobos\stdio.d(142) getch function parameters do
not match argument types ()'
    I must be doing something stupid?.

 2)) Is there any reason D can't have a getch() that does what it says, as
opposed to
 'get_first_char_of_line()' ?   It can be done, and part of the rationale
for D is to
 correct C's flaws.

 Karl Bochert
Jan 08 2002
prev sibling parent "Pavel Minayev" <evilone omen.ru> writes:
"Karl Bochert" <kbochert ix.netcom.com> wrote in message
news:1103_1010544653 bose...
 Two questions:
 1) When I try to hold a dos box open with 'getch ();' I get the error
     message 'E"\dmd\src\phobos\stdio.d(142) getch function parameters do
not match argument types ()'
    I must be doing something stupid?.
Open stdio.d. Do a searh-n-replace: "(void)" => "()". Now it should work.
 2)) Is there any reason D can't have a getch() that does what it says, as
opposed to
 'get_first_char_of_line()' ?   It can be done, and part of the rationale
for D is to
 correct C's flaws.
getch() is not a D function, but a C one. It's just one another advantage of D that it links to C libraries and borrows quite a lot of functions from there, giving us a common set to work with. The native D library is just not fully implemented yet.
Jan 08 2002