Header files

This is a discussion on Header files within the C Programming forums, part of the General Programming Boards category; hey soo this is from other code struct fd_set readFds; i think im missing a header file for this struct ...

  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    192

    Header files

    hey soo this is from other code


    struct fd_set readFds;

    i think im missing a header file for this struct thats in linux and not very sure i thought it was.
    #include <sys/socket.h>
    #include <sys/types.h>
    #include <netinet/in.h>
    #include <netdb.h>
    #include <sys/select.h>
    #include <unistd.h>
    #include <sys/time.h>

    but none of them define fd_set

    does anyone know which header file im missing

  2. #2
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,273
    There is no such thing as "struct fd_set", but there is an "fd_set" and it is in <sys/select.h> (i.e. remove the "struct")
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  3. #3
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    According to this, it should be <sys/select.h>
    <sys/select.h>
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Header files and multiple definitions
    By sjweinberg in forum C++ Programming
    Replies: 16
    Last Post: 07-17-2009, 06:59 PM
  2. Checking array for string
    By Ayreon in forum C Programming
    Replies: 87
    Last Post: 03-09-2009, 04:25 PM
  3. #include header files or .cpp files?
    By DoctorX in forum C++ Programming
    Replies: 3
    Last Post: 12-23-2006, 12:21 PM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21