C语言库函数S类字母1文档格式.docx
《C语言库函数S类字母1文档格式.docx》由会员分享,可在线阅读,更多相关《C语言库函数S类字母1文档格式.docx(21页珍藏版)》请在冰豆网上搜索。
long)
coreleft());
sbrk(1000);
After
return
0;
}
scanf
执行格式化输入
scanf(char
*format[,argument,...]);
conio.h>
label[20];
name[20];
entries
=
loop,
age;
double
salary;
struct
Entry_struct
float
entry[20];
/*
Input
a
label
as
string
of
characters
restricting
to
20
*/
\n\nPlease
enter
for
the
chart:
"
scanf("
%20s"
label);
fflush(stdin);
flush
input
stream
in
case
bad
number
an
integer
How
many
will
there
be?
(less
than
20)
%d"
&
entries);
name
only
letters
upper
or
lower
(loop=0;
loop<
entries;
++loop)
Entry
%d\n"
loop);
Name
:
%[A-Za-z]"
entry[loop].name);
age
Age
entry[loop].age);
salary
Salary
%f"
entry[loop].salary);
name,
and
string,
integer,
\nPlease
your
salary\n"
%20s
%d
%lf"
age,
salary);
Print
out
data
that
was
\n\nTable
%s\n"
label);
Compiled
by
%s
$%15.2lf\n"
-----------------------------------------------------\n"
%4d
|
%-20s
%5d
%15.2lf\n"
loop
+
1,
entry[loop].name,
entry[loop].age,
searchpath
搜索DOS路径
*searchpath(char
*filename);
dir.h>
*p;
Looks
TLINK
returns
pointer
path
p
searchpath("
TLINK.EXE"
Search
TLINK.EXE
p);
non-existent
file
NOTEXIST.FIL"
NOTEXIST.FIL
sector
画并填充椭圆扇区
void
far
sector(int
x,
y,
stangle,
endangle);
graphics.h>
stdlib.h>
request
auto
detection
gdriver
DETECT,
gmode,
errorcode;
midx,
midy,
i;
stangle
45,
endangle
135;
xrad
100,
yrad
50;
initialize
graphics
local
variables
initgraph(&
gdriver,
read
result
initialization
errorcode
graphresult();
if
(errorcode
!
grOk)
error
occurred
Graphics
error:
grapherrormsg(errorcode));
Press
any
key
halt:
getch();
exit
(1);
terminate
code
midx
getmaxx()
/
2;
midy
getmaxy()
through
fill
patterns
(i=EMPTY_FILL;
i<
USER_FILL;
i++)
set
style
setfillstyle(i,
getmaxcolor());
draw
slice
sector(midx,
endangle,
xrad,
yrad);
clean
up
closegraph();
segread
读段寄存器值
segread(struct
SREGS
*segtbl);
dos.h>
segs;
segread(&
segs);
Current
segment
register
settings\n\n"
CS:
%X
DS:
%X\n"
segs.cs,
segs.ds);
ES:
SS:
segs.es,
segs.ss);
setactivepage
设置图形输出活动页
setactivepage(int
pagenum);
select
driver
mode
supports
multiple
pages.
EGA,
gmode
EGAHI,
ht;
x
y
ht
textheight("
W"
off
screen
page
drawing
setactivepage
(1);
line
on
#1
line(0,
0,
getmaxx(),
getmaxy());
output
message
settextjustify(CENTER_TEXT,
CENTER_TEXT);
outtextxy(x,
This
is
#1:
y+ht,
#0
setactivepage(0);
#0."
view
visible
setvisualpage
(1);
setallpallette
按指定方式改变所有的调色板颜色
setallpallette(struct
palette,
*pallette);
palettetype
pal;
color,
maxcolor,
10;
msg[80];
maxcolor
getmaxcolor();
2
*
grab
copy
palette
getpalette(&
pal);
display
default
colors
(color=1;
color<
=maxcolor;
color++)
setcolor(color);
sprintf(msg,
Color:
color);
outtextxy(1,
msg);
+=
wait
black
one
setpalette(color,
BLACK);
restore
setallpalette(&
setaspectratio
设置图形纵横比
setaspectratio(int
xasp,
yasp);
yasp,
midy;
setcolor(getmaxcolor());
get
current
aspect
ratio
settings
getaspectratio(&
normal
circle
circle(midx,
100);
claer
cleardevice();
adjust
wide
setaspectratio(xasp/2,
narrow
setaspectratio(xasp,
yasp/2);
setbkcolor
用调色板设置当前背景颜色
setbkcolor(int
background
colors.
bkcol,
y;