How to resolve compiler warning 'implicit declaration of function memset'

前端 未结 5 948
终归单人心
终归单人心 2021-02-01 02:45

My c code uses \'memset\' and \'close\'. And I have added:

#include 
#include 
#include 

But I sti

5条回答
  •  温柔的废话
    2021-02-01 03:21

    A good way to findout what header file you are missing:

     man 

    To find out the section use:

    apropos 
    

    Example:

     man 3 memset
     man 2 send
    

    Edit in response to James Morris:

    • Section | Description
    • 1 General commands
    • 2 System calls
    • 3 C library functions
    • 4 Special files (usually devices, those found in /dev) and drivers
    • 5 File formats and conventions
    • 6 Games and screensavers
    • 7 Miscellanea
    • 8 System administration commands and daemons

    Source: Wikipedia Man Page

提交回复
热议问题