Posts

Uses of header file

 List of inbuilt C functions in stdio.h file: 1.printf() This function is used to print the character, string, float, integer, octal and hexadecimal values onto the output screen 2.scanf() This function is used to read a character, string, numeric data from keyboard. 3.getc() It reads character from file 4.gets() It reads line from keyboard 5.getchar() It reads character from keyboard 6.puts() It writes line to o/p screen 7.putchar() It writes a character to screen 8.clearerr() This function clears the error indicators 9.f open() All file handling functions are defined in stdio.h header file 10.f close() closes an opened file 11.getw() reads an integer from file 12.putw() writes an integer to file 13.f getc() reads a character from file 14.putc() writes a character to file 15.f putc() writes a character to file 16.f gets() reads string from a file, one line at a time 17.f puts() writes string to a file 18.f eof() finds end of file 19.f getchar reads a character from keyboard 20.f g...

uses of header file(c programming in Turbo c++ compile)

 function in <graphics.h> header file.

input hardware code(c programming in Turbo c ++)

mouse>0x33 keyboard>0x60 use:int86(0x33,&in,&out);

uses of struct wordregs(ax,bx,cx,dx)(c programming in Turbo c++.

 ax=0,support is not available(mean: mouse is not connected) ax=1,show mouse pointer(mean: mouse pointer is show in screen) ax=2,hide mouse pointer(mean: mouse pointer is hide ) ax=3,mouse position when, cx= x position              dx=y position. ax=3,mouse button press. if bx=0,No key is pressed      bx=1,mouse left button is pressed     bx=2,mouse right button is pressed     bx=3,mouse centre button is pressed ax=4,set mouse position where, cx=x coordinate                dx=y coordinate ax=7,set horizontal limits for pointer where,cx=minimum x coordinate                dx=maximum x coordinate ax=8, set vertical limit for pointer  where,cx=minimum y coordinate               dx=maximum y coordinate

getkey from keyboard/control by keyboard(c programming in Turbo c++)

 #include<stdio.h> #include<conio.h> #include,graphics.h> #inlcude<dos.h> int getkey() { union REGS in,out; in.h.ah=0; int86(22,&in,&out); return(out.h.ah); } void main () {               int gd=DETECT,gm,key;               clrscr();               initgraph(&gd,&gm,"c:\\tc\\bgi");               key=getkey();               printf("%d",key);               getch(); }

show mouse pointer(c programming in Turbo c++)

 #include<conio.h> #include<dos.h> #include<graphics.h> void main () {               int gd=DETECT,gm;               union REGS in,out;               clrscr();               in.x.ax=1;               int86(ox33,&in,&out);               getch(); }