diff bet getch() & getche()

P

ppravin88

hi guys 'n' gals .. could anyone tell me the difference between
getch(); and getche();
and when and where should we use this function...


and also wat is the diff between return(); & return(0); &
return(1);..........
 
C

Chris Dollin

hi guys 'n' gals .. could anyone tell me the difference between
getch(); and getche();

The latter doesn't exist in Standard C?
and also wat is the diff between return();

Illegal (no expression in the ()).
& return(0);

Verbose form of `return 0;`.
&
return(1);..........

Verbose form of `return 1;`.

In `main`, `return 0;` means roughly "exit successfully" and
`return 1;` means "exit in a way the C standard does not
specify and hence is as portable as a baby elephant wearing
iron boots and a depleted-uranium flak-jacket".
 
R

Robert Gamble

hi guys 'n' gals .. could anyone tell me the difference between
getch(); and getche();
and when and where should we use this function...

No because they are not Standard C functions but I bet if you take the
time to look them up yourself in your system documentation (or google,
etc.) you can figure it out.
and also wat is the diff between return(); & return(0); &
return(1);..........

"return();" is a syntax error (hint: return is not a function),
"return(0);" returns the value 0 from the current function,
"return(1);" returns the value 1 from the current function. Hope that
helps.

Robert Gamble
 
L

Lew Pitcher

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Chris Dollin wrote:
[snip]
Nice sig, but are you certain that you've got enough significant
digits?
Here's a few more for you:
2.71828182845904523536028747135266249775724709369995

<grin>

- --
Lew Pitcher

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32) - WinPT 0.11.12

iD8DBQFE2ONragVFX4UWr64RAooGAJwP/gAUgh211C3gshYtEdzBZdLKQgCfXQl9
1OqgIS5wdUB3kOBuBk3Wzks=
=mx9f
-----END PGP SIGNATURE-----
 
B

Barry Schwarz

hi guys 'n' gals .. could anyone tell me the difference between
getch(); and getche();
and when and where should we use this function...

Since neither is a standard function, you need to check the
documentation where they are provided.
and also wat is the diff between return(); & return(0); &
return(1);..........

return is not a function. It is a statement. return() is a syntax
error. The other two simply return different values to the calling
function. If they appear in main, return 0 has special meaning
(equivalent to EXIT_SUCCESS) while return 1 is not portable.


Remove del for email
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top