Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

how to declare a struct in c

//option 1
typedef struct STRING{
    char *str;
    int length;
} STRING;
STRING var_name;
//option 2
struct STRING{
	char *str;
    int length;
};
struct STRING var_name;
 
PREVIOUS NEXT
Tagged: #declare #struct
ADD COMMENT
Topic
Name
8+2 =