I have a question about passing parameters through the command line.
My main() looks like
int main(int argc, char **argv){ int b, d, n, flag; char *init_d, tst_dir[100]; argv++; init_d=*(argv++);
If argv is a pointer to an array of pointers, I assign init_d to point to the value pointed to by the argv pointer points to? (If that even makes sense)
I assume that I need to get this value in an array of characters in order to print it, but if I do not know the size of the "string" that I pass, I'm not sure how to achieve this. For example, if I run my code './myprogram hello' compared to './myprogram alongerinput'
mike
source share