473,663 Members | 2,864 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

diff bet getch() & getche()

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);..... .....

Aug 8 '06 #1
6 5148
pp*******@gmail .com wrote:
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

Aug 8 '06 #2
pp*******@gmail .com wrote:
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".

--
Chris "no tusk too difficult" Dollin
"No-one here is exactly what he appears." G'kar, /Babylon 5/

Aug 8 '06 #3
Chris Dollin wrote:
pp*******@gmail .com wrote:
hi guys 'n' gals .. could anyone tell me the difference between
getch(); and getche();

The latter doesn't exist in Standard C?
Neither does the former.

Robert Gamble

Aug 8 '06 #4
Chris Dollin wrote:
pp*******@gmail .com wrote:
>hi guys 'n' gals .. could anyone tell me the difference between
getch(); and getche();

The latter doesn't exist in Standard C?
Robert Gamble points out that getch doesn't either. Bad me.
Sloppy. No biscuit.

--
Chris "the difference is 2.718281828" Dollin
"A facility for quotation covers the absence of original thought." /Gaudy Night/

Aug 8 '06 #5
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Chris Dollin wrote:
[snip]
--
Chris "the difference is 2.718281828" Dollin
Nice sig, but are you certain that you've got enough significant
digits?
Here's a few more for you:
2.7182818284590 452353602874713 526624977572470 9369995

<grin>

- --
Lew Pitcher

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

iD8DBQFE2ONragV FX4UWr64RAooGAJ wP/gAUgh211C3gshYt EdzBZdLKQgCfXQl 9
1OqgIS5wdUB3kOB uBk3Wzks=
=mx9f
-----END PGP SIGNATURE-----

Aug 8 '06 #6
On 8 Aug 2006 06:11:05 -0700, "pp*******@gmai l.com"
<pp*******@gmai l.comwrote:
>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
Aug 10 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2765
by: VivekR | last post by:
Hi, Consider the program snippet below main { .... printf("Enter Choice: "); int choice = getche();
28
9874
by: srikanth | last post by:
help me out with the subject
9
3041
by: James McLaughlin | last post by:
Hi, Does anyone know if it's possible to write either a getch() (preferably Borland-style) or getche() function in C without it being platform-dependent or otherwise non-standard? If not, can someone suggest a good alternative for situations where you require the user to "press any key to continue" or "press Enter to continue" - with getch(), the mistakes that a user can make with getchar() and the like just don't occur.
0
8436
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8858
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8771
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8634
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7371
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2000
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.