Disk I/O Functions in C++
Disk I/O, memory allocation, time-related, and miscellaneous functions in C++ programming with descriptions are listed below. You can find your desired function in the following tables.
Disk I/O Functions
| Function |
Use |
| absread |
Reads absolute disk sectors. |
| abswrite |
Writes absolute disk sectors. |
| biosdisk |
Performs BIOS disk services. |
| getdisk |
Gets current drive number. |
| setdisk |
Sets current disk drive. |
Memory Allocation Functions
| Function |
Use |
| calloc |
Allocates a block of memory. |
| farmalloc |
Allocates memory from far heap. |
| farfree |
Frees a block from far heap. |
| free |
Frees a block allocated with malloc. |
| malloc |
Allocates a block of memory. |
| realloc |
Reallocates a block of memory. |
Process Control Functions
| Function |
Use |
| abort |
Aborts a process. |
| atexit |
Executes function at program termination. |
| execl |
Executes child process with argument list. |
| exit |
Terminates the process. |
| spawnl |
Executes child process with argument list. |
| spawnlp |
Executes child process using PATH variable and argument list. |
| system |
Executes an MS-DOS command. |
Graphics Functions
| Function |
Use |
| arc |
Draws an arc. |
| ellipse |
Draws an ellipse. |
| floodfill |
Fills an area of the screen with the current color. |
| getimage |
Stores a screen image in memory. |
| getlinestyle |
Obtains the current line style. |
| getpixel |
Obtains the pixel's value. |
| lineto |
Draws a line from the current graphic output position to the specified point. |
| moveto |
Moves the current graphic output position to a specified point. |
| pieslice |
Draws a pie-slice-shaped figure. |
| putimage |
Retrieves an image from memory and displays it. |
| rectangle |
Draws a rectangle. |
| setcolor |
Sets the current color. |
| setlinestyle |
Sets the current line style. |
| putpixel |
Plots a pixel at a specified point. |
| setviewport |
Limits graphic output and positions the logical origin within the limited area. |
Time Related Functions
| Function |
Use |
| clock |
Returns the elapsed CPU time for a process. |
| difftime |
Computes the difference between two times. |
| ftime |
Gets current system time as structure. |
| strdate |
Returns the current system date as a string. |
| strtime |
Returns the current system time as a string. |
| time |
Gets current system time as long integer. |
| setdate |
Sets DOS date. |
| getdate |
Gets system date. |
Miscellaneous Functions
| Function |
Use |
| delay |
Suspends execution for an interval (milliseconds). |
| getenv |
Gets value of environment variable. |
| getpsp |
Gets the Program Segment Prefix. |
| perror |
Prints error message. |
| putenv |
Adds or modifies value of environment variable. |
| random |
Generates random numbers. |
| randomize |
Initializes random number generation with a random value based on time. |
| sound |
Turns PC speaker on at specified frequency. |
| nosound |
Turns PC speaker off. |
DOS Interface Functions
| Function |
Use |
| FP_OFF |
Returns offset portion of a far pointer. |
| FP_SEG |
Returns segment portion of a far pointer. |
| getvect |
Gets the current value of the specified interrupt vector. |
| keep |
Installs terminate-and-stay-resident (TSR) programs. |
| int86 |
Issues interrupts. |
| int86x |
Issues interrupts with segment register values. |
| intdos |
Issues interrupt 21h using registers other than DX and AL. |
| intdosx |
Issues interrupt 21h using segment register values. |
| MK_FP |
Makes a far pointer. |
| segread |
Returns current values of segment registers. |
| setvect |
Sets the current value of the specified interrupt vector. |