, , . , #include , . .
: /, , , , , .
stdio.h , /:
printf(...) ( );
puts(s) , s ( s);
putchar(c) c ( c);
scanf(...) ( );
gets(s) , s ( s);
getchar() , , EOF;
fflush(stdin) stdin , ;
fopen(...) ( );
fscanf(fp,...) ( );
fprintf(fp,...) ( );
fclose(fp) , fp ( EOF );
rewind(fp) fp ( );
fgets(s,n,fp) n-1 fp s ( s);
fputs(s,fp) s fp ( s);
...
string.h ():
strcat(s,t) t s;
strncat(s,t,n) n t s;
strcmp(s,t) , s < t, s == t, s > t ;
strncmp(s,t,n) , strcmp, n;
strcpy(s,t) t s;
strncpy(s,t,n) n t s;
strlen(s) s;
strchr(s,c) c s , c s, NULL;
strrchr(s,c) c s , c s, NULL;
strstr(s,t) t s NULL ;
...
ctype.h . (), c char , () .
|
|
isdigit(c) ;
isxdigit(c) ;
isalpha(c) ;
isupper(c) ;
islower(c) ;
isalnum(c) ;
isspace(c) , , , ;
isgraph(c) ;
isprint(c) ;
ispunct(c) , ;
iscntrl(c) .
, :
tolower(c) ;
toupper(c) .
math.h ( double):
sin(x) ;
cos(x) ;
tan(x) ;
asin(x) ;
acos(x) ;
atan(x) ;
sinh(x) ;
cosh(x) ;
tanh(x) ;
exp(x) ( );
log(x) ;
log10(x) ;
pow(x,y) ;
sqrt(x) ;
ceil(x) , x;
floor(x) , x;
fabs(x) ;
...
stdlib.h , :
atof(s) double;
atoi(s) int;
atol(s) long;
rand() 0 RAND_MAX = 32767;
srand(seed) seed () ( seed = 1);
malloc(size) size , , NULL;
free(p) , ;
exit(status) : status EXIT_SUCCESS, EXIT_FAILURE;
system(s) s ;
...
time.h , .
:
time_t , long , time(tp);
struct tm {
tm_sec // (0, 59)
tm_min // (0, 59)
tm_hour // (0, 23)
tm_mday // (1, 31)
tm_mon // (0, 11)
tm_year // 1900
|
|
tm_wday // (0, 6)
tm_yday // 1 (0, 365)
tm_isdst //
};
:
clock() , . : clock()/CLOCKS_PER_SEC;
time(tp) . tp ( time_t) NULL, *tp;
ctime(tp) ;
difftime(t1,t2) t1 t2;
localtime(tp) tm, ;
...
graphics.h , : , , , , . ( 50 , ).