, -. ++ : , ( <string.h> <cstring>), ++ string.
(strcpy, strncpy), (strcmp, strncmp), (strcat, strncat), (strstr), (strchr, strnchr, strbrk) strlen .
char *strcat (char *s1, char *s2);
s2 s1 s1. -.
char *strchr (char *s, int ch);
ch s, , NULL.
int *strcmp (char *s1, char *s2);
s1 s2 ( s1<s2), (s1=s2) (s1>s2).
char *strcpy (char *s1, char *s2);
s2 s1 s1.
size_t strlen(char*s);
( ).
char *strncat (char *s1, char *s2, size_t n);
n s2 s1 s1.
int strncmp (char *s1, char *s2, size_t n);
s1 n s1. , strcmp.
char *strncpy (char *s1, char *s2, size_t n);
n s2 s1 s1. s2 n , - s1 . - n- .
char *strchr (char *s, int ch);
ch s , , NULL.
char *strstr (char *s1, char *s2);
s2 s1. s1, s2, NULL − .
double strtod (const char *str, char **end);
. +/-HUGE_VAL. 0. end , .
e <stdlib.h> :
double atof (const char *p);
double.
int atoi (const char *p);
int.
long atol (const char *p);
long.
. . , 0. , errno ( <cerrno>) ERANGE .
sprintf:
|
|
int sprintf (char *buffer, const char *format [, argument,...]);
buffer , , , format.
( <ctype.h>) :
isalpha | (A-Z, a-z, 0-9) |
isalnum | (A-Z, a-z, 0-9) |
isdigit | (0-9) |
isxdigit | (0-9, A−F, a−f) |
iscntrl | ( 0..31 127) |
islower | (a-z) |
isupper | (A-Z) |
isgraph | , |
ispunct | |
isprint | |
isspace | - |
int true, .
ch :
int tolower (int ch);
int to upper (int ch);
. :
- ;
- ;
- ;
- .
++ , <math.h> (<cmath>). (abs, fabs), (ceil, floor), (sqrt), (pow), (sin, cos, tan, asin, acos, atan .), (exp), (log, log10), (modf), (fmod) .
errno <errno.h> EDOM ERANGE .
int abs (int num);
long labs(long int num);
double fabs(double x);
.
double acos(double x);
double asin(double x);
double atan(double x);
double atan2(double x);
, , . .
double cos(double x);
double sin(double x);
double tan(double x);
double tan2(double x);
, , , , .
div_t div (int numerator, int denomerator);
numerator denomerator, , :
struct div_t {
int quot;
int rem;
}
double exp(double x);
.
double floor (double x);
.
double log (double x);
double log10 (double x);
.
double modf (double x, double *intptr);
, , , intptr.
double pow (double x, double y);
.
int rand(void);
0 RAND_MAX ( <stdlib.h>.
|
|
double sqrt(double x);
.
, .
. . #.
#include
#include < > , . #include. , .
#include , .
.h :
- , , , , ;
- , , , ;
- (. );
- ;
- .
. , .
.h . <name.h> ++ <name>, std (. ).
#define
. :
- :
#define _;
- , , :
#define () _;
- , . #ifdef #ifndef. :
#define ;
#define VASIA ""
#define MAX(x,y) ((x)>(y)? (x): (y))
, . , , MAX y=MAX(sum1,sum2); y= ((sum1)>(sum2)? (sum1): (sum2));
!!! , ++ . const enum, − . inline, . , .