Ðåôåðàò: Turbo C++ Programer`s guide
Ýòè ïîäïðîãðàììû ðåàëèçóþò âñòðîåííûå ñðåäñòâà
ïîèñêà îøèáêè.
assert(assert.h)
matherr(math.h)
perror(errno.h)
Ãðàôè÷åñêèå
ïîäïðîãðàììû --------------------------------
Ýòè ïîäïðîãðàììû ïîçâîëÿþò ñîçäàâàòü ýêðàííûå ãðàôè÷åñêèå ïðåäñòàâëåíèÿ ñ
òåêñòîâîé ÷àñòüþ.
arc
(graphics.h) fillellipse (graphics.h)
bar
(graphics.h) fillpoly (graphics.h)
bar3d
(graphics.h) floofill (graphics.h)
circle
(graphics.h) getarccoords (graphics.h)
cleardevice
(graphics.h) getaspectratio (graphics.h)
clearviewport(graphics.h) getbkcolor (graphics.h)
closgraph (graphics.h) getcolor (graphics.h)
detectgraph
(graphics.h) getdefaultpallette(graphics.h)
drawpoly
(graphics.h) getdrivername (graphics.h)
ellipse
(graphics.h) getfillpattern (graphics.h)
getfillsettings
(graphics.h) outtext (graphics.h)
getgraphmode (graphics.h)
outtextxy(graphics.h)
getimage (graphics.h)
pieslice (graphics.h)
getfinesettings
(graphics.h) pufimage (graphics.h)
getmaxcolor (graphics.h)
pulpixel (graphics.h)
getmaxmode (graphics.h)
rectangle(graphics.h)
getmaxx (graphics.h)
registerbgidriver(graphics.h)
getmaxy (graphics.h)
registerbgifont (graphics.h)
getmodename (graphics.h)
restorecrtmode (graphics.h)
getmoderange (graphics.h)
sector (graphics.h)
getpalette (graphics.h)
settaffpalette (graphics.h)
getpixel (graphics.h)
setaspectratio (graphics.h)
gettextsettings
(graphics.h) setbkcolor (graphics.h)
getviewsettings
(graphics.h) setcolor (graphics.h)
getx (graphics.h)
setcursortype (conio.h)
gety (graphics.h)
setfillpattern (graphics.h)
graphdefaults (graphics.h) setfillstyle
(graphics.h)
grapherrormsg (graphics.h) setgraphbufsize
(graphics.h)
_graphfreemem (graphics.h) setgraphmode
(graphics.h)
_graphgetmem (graphics.h) setlinestyle
(graphics.h)
graphresult (graphics.h) setpalette
(graphics.h)
imagesize (graphics.h) setrgbpalette
(graphics.h)
initgraph (graphics.h) settextjunistify
(graphics.h)
installuserdriver(graphics.h)settexttyle (graphics.h)
installuserfont
(graphics.h)setusercharsize (graphics.h)
line (graphics.h)setviewport (graphics.h)
linerel (graphics.h)setvisualpage (graphics.h)
lineto (graphics.h)setwritemode (graphics.h)
moverei (graphics.h)textheight (graphics.h)
moveto (graphics.h)textwidth (graphics.h)
Ïîäïðîãðàììû ââîäà/âûâîäà
--------------------------------
Ýòè ïîäïðîãðàììû ðåàëèçóþò ñðåäñòâà ââîäà/âûâîäà íà
óðîâíå ïîòîêîâ è DOS.
access
(io.h)creatnew (io.h)
cgets
(conio.h)creattemp (io.h)
_chmod
(io.h)cscanf (conio.h)
chmod
(io.h)dup (io.h)
chsize
(io.h)dup2 (io.h)
clearerr
(stdio.h)eof (io.h)
_close
(io.h)fclosse (stdio.h)
close
(io.h)fcloseali (ctdio.h)
cprintf
(conio.h)fdopen (stdio.h)
cputs
(conio.h)foof (stdio.h)
_creat
(io.h)ferror (stdio.h)
creat
(io.h)fflush (stdio.h)
fgetc
(stdio.h)printf (stdio.h)
fgetchar
(stdio.h)putc (stdio.h)
fgetpos
(stdio.h)putch (conio.h)
fgets
(stdio.h)putchar (stdio.h)
fllelength
(io.h)puts (stdio.h)
flleno
(stdio.h)putw (stdio.h)
flushall
(stdio.h)_read (io.h)
fopen
(stdio.h)read (io.h)
fprintf
(stdio.h)remove (stdio.h)
fputc
(stdio.h)rename (stdio.h)
fputchar
(stdio.h)rewind (stdio.h)
fputs
(stdio.h)scanf (stdio.h)
fread
(stdio.h)setbuf (stdiio.h)
freopen
(stdio.h)setcursortype (conio.h)
fscanf
(stdio.h)setftime (io.h)
fseek
(stdio.h)setmode (io.h)
fsetpos
(stdio.h)setvbuf (stdio.h)
fstat
(sys\stat.h)sopen (io.h)
ftell
(stdio.h)sprintf (stdio.h)
fwrite
(stdio.h)sscanf (stdio.h)
getc
(stdio.h)stat (sys\stat.h)
getch
(conio.h) _strerror (string.h,stdio.h)
getchar
(stdio.h) strerorr (stdio.h)
getche
(conio.h) tell (io.h)
getftime
(io.h) tmpfile (stdio.h)
getpaus
(conio.h) tmpnam (stdio.h)
gets
(stdio.h) ungetc (stdio.h)
getw
(stdio.h) ungetch (conio.h)
iocti (io.h) unlock (io.h)
isatty
(io.h) vfprintf (stdio.h)
kbhit
(conio.h) vfscanf (stdio.h)
lock (io.h) vprintf (stdio.h)
iseek (io.h) vscanf (stdio.h)
_open (io.h) vsprintf (stdio.h)
open (io.h) vsscanf (io.h)
perror (stdio.h) _write (io.h)
Ïîäïðîãðàììû èíòåðôåéñà --------------------------------- (DOS, 8086,
BIOS)
Ýòè ïîäïðîãðàììû ðåàëèçóþò îáðàùåíèÿ ê ñðåäñòâàì DOS, BIOS
è ñïåöèôè÷íûì ñðåäñòâàì äàííîãî êîìïüþòåðà.
absread (dos.h)
bioskey (bios.h) dosexterr (dos.h)
abswrite (dos.h)
bioskey (bios.h) enable (dos.h)
bdos (dos.h)
biosprint (bios.h) FP_OFF (dos.h)
bdosptr (dos.h)
biostime (bios.h) FP_SEG (dos.h)
bioscom (bios.h)country
(dos.h) freemem (dos.h)
blosdisk (bios.h)ctrlbrk
(dos.h) geninterrupt(dos.h)
biosequip(bios.h)disable
(dos.h) getcbrk (dos.h)
getdfree (dos.h) int86
(dos.h) poke (dos.h)
getdta (dos.h) int86x
(dos.h) pokeb (dos.h)
getfat (dos.h) intdos
(dos.h) randbrd (dos.h)
getfatd (dos.h) intdosx
(dos.h) randbwr (dos.h)
getpsp (dos.h) intr
(dos.h) segread (dos.h)
getvect (dos.h) keer
(dos.h) setcbrk (dos.h)
getverity(dos.h)
MK_FP (dos.h) setdta (dos.h)
harderr
(dos.h) outport (dos.h) setvect (dos.h)
hardresume(dos.h)outportb
(dos.h) setverity (dos.h)
hardretn(dos.h)parsfnm
(dos.h) sleep (dos.h)
inport(dos.h)peek
(dos.h) unlink (dos.h)
inportb(dos.h)peekb (dos.h)
Ïîäïðîãðàììû ìàíèïóëÿöèè
--------------------------------
Ýòè
ïîäïðîãðàììû îáðàáàòûâàþò ñòðîêèè áëîêè ïàìÿòè: êîïèðîâàíèå, ñðàâíåíèå,
ïðåîáðàçîâàíèÿ è ïîèñê.
memccpy(mem.h,string.h) stricmp(string.h)
memchr(mem.h,string.h) stricmpi(string.h)
memcmp(mem.h,string.h) sprien(string.h)
memcpy(mem.h,string.h) striwr(string.h)
memicmp(mem.h,string.h) stncat(string.h)
memmoye(mem.h,string.h) stncmp(string.h)
memset(mem.h,string.h) strncmpi(string.h)
movedata(mem.h,string.h) strncpy(string.h)
movmem(mem.h,string.h) strnicmp(string.h)
setmem(mem.h) strnset(string.h)
stpcpy(string.h)
strpbrk(string.h)
strcat(string.h)
strrchr(string.h)
strchr(string.h)
strrev(string.h)
strcmp(string.h)
strset(string.h)
strcoll(string.h) strspn(string.h)
strcpy(string.h) strstr(string.h)
strcspn(string.h) strtok(string.h)
strdup(string.h) strupr(string.h)
strerror(string.h) strxfrm(string.h)
Ìàòåìàòè÷åñêèå ïîäïðîãðàììû
----------------------------- Ýòè ïîäïðîãðàììû âûïîëíÿþò ìàòåìàòè÷åñêèå
âû÷èñëåíèÿ è
ïðåîáðàçîâàíèÿ.
abs (complex.h,stdlib.h)
atof(stdlib.h,math.h)
acos (complex.h,math.h)
atoi(stdlib.h)
arg (complex.h)
atol(stdlib.h)
asin (complex.h,math.h)
bcd(std.h)
atan (complex.h,math.h)
cabs(math.h)
atan2 (complex.h,math.h)
ceil(math.h)
clear87 (float.h)
ltoa(stdlib.h)
complex (complex.h)
_matherr (math.h)
conj (complex.h)
matherr(math.h)
_control(float.h) modf(math.h)
cos (complex.h,math.h)
norm(complex.h)
cosh (complex.h,math.h)
polar(complex.h)
div (math.h)
poly(math.h)
ecvt (stdlib.h)
pow(complex.h,math.h)
exp (math.h)
pow10(math.h)
fabs (math.h)
rand(stdlib.h)
fcvt (stdlib.h)
random(stdlib.h)
floor (math.h)
randomize(stdlib.h)
fmod (math.h)
real(complex.h)
_fpreset(float.h) _rotl(stdlib.h)
frexp (math.h)
_rotr(stdlib.h)
gcvt (stdlib.h)
sin(complex.h,math.h)
hypot (math.h)
sinh(complex.h,math.h)
imag (complex.h)
sqrt(complex.h,math.h)
itoa (stdlib.h)
srand(stdlib.h)
labs (stdlib.h)
_status87(float.h)
ldexp (math.h)
strtod(stdlib.h)
ldiv (math.h)
strtol(stdlib.h)
log (complex.h,math.h)
strtoul(stdlib.h)
log10 (complex.h,math.h)
tan(complex.h,math.h)
_lrotl (stdlib.h)
tanh(complex.h,math.h)
_lrotr (stdlib.h)
ultoa(stdlib.h)
Ïîäïðîãðàììû óïðàâëåíèÿ ïàìÿòüþ
-------------------------
Ýòè ïîäïðîãðàììû îáåñïå÷èâàþò äèíàìè÷åñêîå
ðàñïðåäåëåíèå ïàìÿòè äëÿ ìîäåëåé äàííûõ small è large
allocmem (dos.h) farrealloc (alloc.h)
brk (alloc.h) free (alloc.h,
calloc (alloc.h)
stdlib.h)
coreleft (alloc.h, heapcheck (alloc.h)
stdlib.h) heapcheckfree
(alloc.h)
farcalloc (alloc.h) heapcheckknode
(alloc.h)
farcoreleft (alloc.h) heapwalk (alloc.h)
farfree (alloc.h) malloc (alloc.h,
farheapcheck (alloc.h)
stdlib.h)
farheapcheckfree(alloc.h) realloc (alloc.h,
farheapchecknode(alloc.h)
stdlib.h)
farheapfllfree
(alloc.h) sbrk (alloc.h)
farheapwalk (alloc.h) setblock (dos.h)
farmalloc (alloc.h)
Ðàçíûå ïîäïðîãðàììû
-------------------------------------
Ýòè ïîäïðîãðàììû ïðåäîñòàâëÿþò ñðåäñòâà ïåðåõîäà çà
ïðåäåëû ëîêàëüíîãî êîíòåêñòà, ðàçëè÷íûå çâóêîâûå ýôôåêòû è ëîêàëüíûå ýôôåêòû.
delay (dos.h) setjmp (setjmp.h)
localeconv (locale.h) setlocale (locale.h)
longjmp (setjmp.h) sound (dos.h)
nosound (dos.h)
Ïîäïðîãðàììû
óïðàâëåíèÿ ïðîöåññàìè ----------------------
Ýòè ïîäïðîãðàììû çàïóñêàþò è çàâåðøàþò âûïîëíåíèå îäíèõ ïðîöåññîâ èç
äðóãèõ.
abort (process.h) execvp (process.h) spawnl (process.h)
execl
(process.h) execvpe(process.h) spawnle (process.h)
execle
(process.h) _exit (process.h) spawnlp (process.h)
execlp
(process.h) exit (process.h) spawnlpe(process.h)
execlpe(process.h) getpid
(process.h) spawnv(process.h)
execv
(process.h) reise (signal.h)spawnve (process.h)
execve
(process.h) signal (signal.h)spawnvp (process.h)
spawnvpe(process.h)
Ñòàíäàðòíûå
ïîäïðîãðàììû --------------------------------
Ýòè ïîäïðîãðàììû ÿâëÿþòñÿ
ñòàíäàðòíûìè.
abort
(stdlib.h) exit (stdlib.h)malloc(stdlib.h)
abs
(stdlib.h) fcvt (stdlib.h)putenv(stdlib.h)
atexit
(stdlib.h) free (stdlib.h)qsort(stdlib.h)
atof
(stdlib.h) gcvt (stdlib.h)rand(stdlib.h)
atol
(stdlib.h) getenv (stdlib.h)realloc (stdlib.h)
atol
(stdlib.h) itoa (stdlib.h)srand(stdlib.h)
bsearch(stdlib.h)
labs (stdlib.h)stdtod(stdlib.h)
calloc
(stdlib.h) lfind (stdlib.h)strtol(stdlib.h)
ecvt
(stdlib.h) lsearch(stdlib.h)swab(stdlib.h)
_exit (stdlib.h) itoa
(stdlib.h)system(stdlib.h)
Ïîäïðîãðàììû
âûâîäà íà äèñïëåé òåêñòîâûõ îêîí -------------
Ýòè ïîäïðîãðàììû âûâîäÿò òåêñò
íà ýêðàí.
clreol
(conio.h) gotoxy (conio.h)
clrscr
(conio.h) highvideo (conio.h)
delline
(conio.h) insline (conio.h)
gettext
(conio.h) lowvideo (conio.h)
gettextinvo(conio.h) movetext
(conio.h)
normvideo (conio.h)
textcolor (conio.h)
puttext (conio.h)
textmode (conio.h)
necursortype
(conio.h) wherex (conio.h)
textattr (conio.h)
wherey (conio.h)
textbackground(conio.h) window (conio.h)
Ïîäïðîãðàììû
âðåìåíè è äàòû -----------------------------
Ýòè ïîäïðîãðàììû ïðåäíàçíà÷åíû äëÿ ïðåîáðàçîâàíèé è ìàíèïóëÿöèé âðåìåíåì
è äàòîé.
asctime (time.h)
mktime (time.h)
ctime (time.h)
setdate (dos.h)
difftime (time.h)
settime (dos.h)
dostounix (dos.h)
stime (time.h)
ftime (sys\timeb.h)strftime
(time.h)
getdate (dos.h)
time (time.h)
gettime (dos.h)
tzset (time.h)
gmtime (time.h)
unixtodos (dos.h)
locoltime (time.h)
Ïîäïðîãðàììû äëÿ îáðàáîòêè
ïåðåìåííîãî ñïèñêà àðãóìåíòîâ
Ýòè ïîäïðîãðàììû èñïîëüçóþòñÿäëÿ äîñòóïà ê
ïåðåìåííûì ñïèñêàì àðãóìåíòîâ (íàïðèìåð, vprintf è ò.ä.).
va_arg (stdarg.h)
va_end (stdarg.h)
va_stsrt (stdarg.h)
Ãëàâà 3 Ïîòîêè Ñ++
Äàííàÿ ãëàâà ñîäåðæèò êðàòêèé îáçîð ââîäà/âûâîäà
ïîòîêîâ Ñ++. Ââîä/âûâîä ïîòîêîâ â Ñ++èñïîëüçóåòñÿ äëÿ ïðåîáðàçîâàíèÿ
òèïèçèðîâàííûõ îáúåêòîâ â ÷èòàåìûé òåêñò, è îáðàòíî. Îí ïîçâîëÿåò îïðåäåëÿòü
ôóíêöèè ââîäà/âûâîäà, êîòîðûå çàòåì àâòîìàòè÷åñêè èñïîëüçóþòñÿ ïðèìåíèòåëüíî ê
ñîîòâåòñòâóþùèì îïðåäåëåííûõ ïîëüçîâàòåëåì òèïàì. Ïîñëåäóþùèå ïðèìåðû íàõîäÿòñÿ
â Ãëàâå 5, "Îñíîâû Ñ++" äîêóìåíòà "Íà÷àëî ðàáîòû";
ïðèâîäèìàÿ òàì æå áèáëèîãðàôèÿ ïðåäëàãàåò íåñêîëüêî íàçâàíèé êíèã äëÿ óãëóáëåííîãî
èçó÷åíèÿ äàííîãî ïðèìåðà.
Íîâûå ïîòîêè âìåñòî ñòàðûõ
Turbo C++ ïîääåðæèâàåò êàê ñòàðóþ áèáëèîòåêó Ñ++
stream, òàê è íîâóþ óñîâåðøåíñòâîâàííóþ áèáëèîòåêó iostream Ñ++ âåðñèè 2.0.
Âîçìîæíîñòü ðàáîòû ñ îáåèìè âåðñèÿìè ïîìîæåò âàì, åñëè ó âàñ èìåþòñÿ ïðîãðàììû,
íàïèñàííûå ïî ñòàðûì ñîãëàøåíèÿì, è âû æåëàåòå èñïîëüçîâàòü Turbo C++ äëÿ
ïåðåõîäà ê áîëåå ýôôåêòèâíûì ïîòîêàì ââîäà/âûâîäà âåðñèè2.0. Ìû íàñòîÿòåëüíî
ðåêîìåíäóåì âàìïðè ñîçäàíèè íîâûõ ïðîãðàìì ïîëüçîâàòüñÿ áèáëèîòåêîé iostream
âåðñèè 2.0. Ïðèâîäÿ íåêîòîðûå ìàòåðèàëû, íåîáõîäèìûå äëÿïåðåõîäà ê ïîòîêàì
âåðñèè 2.0 (íà÷èíàÿ ñî ñòð.184 îðèãèíàëà), äàííàÿ ãëàâà ãëàâíûì îáðàçîì
ïîñâÿùàåòñÿ êëàññàì èïðàâèëàì ïîòîêîâ iostream âåðñèè 2.0.
Ñòðàíèöû: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40
|