Friday, February 11, 2022

difference between getch and getche

 
For video lectures please visit and subscribe the channel
https://youtu.be/dq6vEoGCkoI

Whatsup group
https://chat.whatsapp.com/LbV9FNen1eT5C2VDhThFOe



getch()

The word getch stands for get character, The getch function is used to input a single character from the user. When the functions are executed, it waits for any key to be pressed. The character entered by the user is not displayed on the screen

The function getch() is defined in the header file conio.h therefore the header file must be included in the program to sue this function.

Syntax:

Method-1:

getch();

This is normally used in a program to stop the execution of the program temporarily.

Method-2:

variable= getch();

It takes any character from the keyboard and stores that character in the variable 

 

 

getche():

The word getche() stands for get character. The letter e in getche stands for echo. the () function is used to input a single character from the user. When this function is executed, it waits for any key to be pressed. The function echos (display) the character on the screen entered by the user.

Syntax:

variable= getche();

__________________________________________________________________________ 

gets () function:

 The gets function is used to input string values from the user. The input is stored in a string variable. The user can enter any type of letter including alphabets, digits, special symbols, and spaces. After typing the string from the keyboard, the user presses ENTER key and the string is stored in the variable. The null characters \0 are automatically entered at the end of the string.

Syntax:

gets(variable);



No comments:

Post a Comment

Which Field to Choose after Inter

انٹرمیڈیٹ_کے_طلباء_و_طالبات_متوجہ_ہوں۔... یہ پوسٹ آپ کے مستقبل سے متعلق ہے۔ عام طور پر میڈیکل کے طلبہ سمجھتے ہیں کہ میڈیکل میں ایم بی بی ایس...