argument to struct

I want take command-line arguments to struct object and puts it from struct next.
1
2
3
4
5
6
7
8
9
10
struct s{
    char **args;
};
int cmd(int argc, char *argv[]){
char args[1];
char args[2];
char args[3];
char args[4];
}
printf("%s\n", s.args);

Why it doesn't work?
Um, you have a lot of errors in there...ok, you first need to use int main() to get the arguments. Second, you are redefining args[] multiple times, you only need to define it once. Third, you have a printf() in global space, it won't work.
Topic archived. No new replies allowed.