J
J
Jek2020-10-13 14:41:27
C++ / C#
Jek, 2020-10-13 14:41:27

Is it a function that returns a struct?

a couple of months ago I studied C from a book and outlined it in a file, I forgot what island *create(char *name) is
typedef struct island
{
char *name;
char*opens;
char *closes;
struct island *next;
} island;

island *create(char *name)
{
island *i = malloc(sizeof(island));
i->name = strdup(name);
i->opens = "09:00";
i->closes = "17:00";
i->next = NULL;
return i;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Timur Pokrovsky, 2020-10-13
@Makaroshka007

is a function that returns a pointer to a structure

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question