So I'm a new learner, and I can't seem to figure out why I'm getting the following errors when trying to compile this code. For reference, I'm learning out of the "Head First C" book and this is an example they give early on in chapter 9. Although I've copied it exactly, it still doesn't work and I'm confused as to why. It looks to me like I'm giving it the parameter it wants, so I can't figure out what else it's asking for.
code:
#include <stdio.h>
#include <stdlib.h>
char *my_env[] = {"JUICE=peach and apple", NULL};
execle("dinerinfo", "dinerinfo", "4", NULL, my_env);
Errors:
cc my_env.c -o my_env
my_env.c:5:8: error: expected parameter declarator
execle("dinerinfo", "dinerinfo", "4", NULL, my_env);
^
my_env.c:5:8: error: expected ')'
my_env.c:5:7: note: to match this '('
execle("dinerinfo", "dinerinfo", "4", NULL, my_env);