The header file graphics.h contains putpixel() function which plots a pixel at location (x, y) of specified color.
The header file graphics.h contains drawpoly function which is used to draw polygons i.e. Triangle, rectangle, pentagon, hexagon etc. Syntax: void drawpoly( int number, int.polypoints ); where, number indicates (n + 1) number of points where n is the number of vertices in a polygon. Polypoints points to a sequence of (n.2) integers.
Explanation : A RED color pixel at (50, 40) can be drawn by using putpixel(50, 40, RED). putpixel() function can be used to draw circles, lines and ellipses using various algorithms.
Below is the implementation of putpixel() function.
Function getch in C program prompts a user to press a character. It doesn't show up on the screen. Its declaration is in 'conio.h' header file. The function is not a part of standard C library.
printf('Waiting for a character to be pressed from the keyboard to exit.n');
When you run this program, it exits only when you press a character. Try pressing num lock, shift key, etc. (program will not exit if you press these keys) as these are not characters.
Try running the program by removing getch. In this case, it will exit without waiting for a character hit from the keyboard.
cout <<'Enter a character';
Function getch works in Dev C++ compiler but it doesn't support all functions of 'conio.h' as Turbo C compiler does.
Sep 28, 2018 Can Atif Aslam Could Sing Without Music Or Autotune? Watch Till End Comment Ur Opinions! Get In Touch With Us On Social Media. Sep 04, 2018 50+ videos Play all Mix - Real Voice Without Autotune Bollywood Songs Arijit Singh, Atif Aslam, Armaan Malik YouTube; Best Of. ATIF ASLAM Songs Best Of Atif Aslam. Atif aslam without auto tune. Aug 31, 2017 Funny Interview Of Atif Aslam And Sonu Nigam Must watch - Duration: 4:37. Atif Aslam 318,483 views.
A common use of getch is you can view the output (if any) of a program without having to open the output window if you are using Turbo C compiler or if you are not running your program from the command prompt.