Home arrow C and C+ arrow Defining a Structure in C Language
Defining a Structure in C Language PDF
Wednesday, 08 February 2012
Example:

struct packet {
    int psource;
    int pdest;
    int length;
    int checksum;
    char date[32];
};


To define variable of type struct:

struct packet varname;

If you want to just use packet varname; for defining the variable then you must previously use typedef:

typedef struct packet packet;

 
< Prev   Next >

Other BSD Systems

OpenBSD

Misc

Solaris

Polls

Best BSD firewall?