Is it possible to return a struct from a function in C? I tried, can you tell me what is wrong.
C++
struct command(){
struct list_commands {
char selector[LENGHT];
int index;
char direction[LENGHT];
int locations;
} list_commands;
printf("Insert the command in the format: ");
scanf("%s %d %s %d", &selector, &index, &direction, &locations);
return list_commands;
}
Salman BegRank #284 · 8.8K reputationPosted Jun 29, 2021, 9:02 AM EDT
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Jun 29, 2021, 10:47 AM EDT