Hi guys, I'm learning C and I still don't have some concepts very clear in my mind.
I have to create a program that get the values from ARGV[] and puts into a vector:
the program would work like that:
./program file1 file2 file3
My idea was to do something like:
n=argc
char command[argc]
for(i<argv) { strcpy(command[i], argv[i+1]) }
But I get a warning.
I think I'm messing up the pointers, char, etc.
What I imagine I'm doing with that code line is creating someting like...
ARGV -------------> command
[program] strcpy... [file1 ]
[file1 ] [file2 ]
[file2 ] [file3 ]
[file3 ]
...but probably its only in my head! Wtf am I doing ? How this should be written to work ???