How to include socket.h in my c file in Ubuntu -


this a.c code :

#include <stdio.h> #include <socket.h>   int main(void) {     int count[4] = {[2] = 3  }, i;      (i = 0; < 4; i++)         printf("count[%d]=%d\n", i, count[i]);     return 0; } 

when compile it, shows:

a.c:2: fatal error: socket.h: no such file or directory compilation terminated. 

so how include / can download it?

it should be:

#include <sys/socket.h> 

paths given relatively /usr/include path. e.g. socket.h file under /usr/include/sys/socket.h. can search if don't know:

find /usr/include/ -name searched_header.h 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -