C语言常用函数所在的头文件

stdio.h


#include <stdio.h>

FILE   *fopen(const char  *filename,  const char   *mode);
int        fclose(FILE   *stream);
int         fflush(FILE   *stream);
size_t   fread(void    *buffer,  size_t size, size_t count, FILE  *stream);
size_t    fwrite(const void  *buffer, size_t size, size_t count,   FILE *stream);
long   ftell(FILE  *stream);
int       fseek(FILE  *stream, long   offset,   int  origin);
void     rewind(FILE  *stream);

stdlib.h

#include <stdlib.h>

void*  malloc(size_t size);
void*  free(void* ptr);

//  Allocates memory for an array of num objects of size size and initializes all bytes in the allocated storage to zero.
// num :  the number  of   elements
// size : size of each element
void*  calloc(size_t num, size_t size);
void*   realloc(void*  ptr, size_t  new_size);

int  atoi(const char   *str);
long  atol(const char   *str);
long  long  atoll(const  char   *str);
double atof(const   char    *str);

stdbool.h

#include <stdbool.h>   // Support boolean type
bool   b1 = true;
bool   b2 = false;

stddef.h

#include <stddef.h>
size_t
ptrdiff_t
NULL

string.h

#include <string.h>
int    isalnum( int  ch);
int     isalpha( int   ch);
int     islower(int  ch);
int     isupper(int  ch);


// int ch :    ch is in byte unit
void*   memset(void *dest, int ch, size_t count);
size_t   strlen(const char* str);
int  strcmp(const char   *lhs,  const char   *rhs);
posted @ 2024-07-12 16:34  EdisoNewton  阅读(44)  评论(0)    收藏  举报