Is it possible to return a struct from a function in C? I tried, can you tell me what is wrong.
struct command(){ struct list_commands { char selector[LENGHT]; int index; char direction[LENGHT]; int locations; } list_commands; printf("Insert the command in the format: <selector> <index> <direction> <locations>"); scanf("%s %d %s %d", &selector, &index, &direction, &locations); return list_commands; }