Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

how to pass an array of structs as an argument in c

struct Items
{
    char code[10];
    char description[30];
    int stock;
};

void ReadFile(struct Items items[10])
{
    ...
}

void xxx()
{
    struct Items MyItems[10];
    ReadFile(MyItems);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pass #array #structs #argument
ADD COMMENT
Topic
Name
6+8 =