what is the difference between getch() and getchar()?

Answer Posted / barath krishnan

getchar() is very similar to using scanf with %c. The getch() function is normally used in 2 cases
1 To read any character not just numbers and alphabets but any
non white space character ( any key oder dan num/caps/scroll locks or tab keys)
2 To keep reading from a stream of inputs without forcing the user to press enter key at the end of each input unlike getchar()

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?

608


Write a program to reverse a given number in c language?

620


The __________ attribute is used to announce variables based on definitions of columns in a table?

671


How can I copy just a portion of a string?

818


If null and 0 are equivalent as null pointer constants, which should I use?

578






what is the different bitween abap and abap-hr?

1743


What is static identifier?

704


if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0

1450


What are c identifiers?

629


What is putchar() function?

637


What are extern variables in c?

549


Write a program to find factorial of a number using recursive function.

646


Do pointers need to be initialized?

562


1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.

1662


Is python a c language?

552