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: ");
scanf("%s %d %s %d", &selector, &index, &direction, &locations);
return list_commands;
}
Rajanikant HawaldarPosted Jun 29, 2021, 2:47 PM
Salman BegPosted Jun 29, 2021, 1:02 PM