so i\'ve created a function that deals with a array of char pointers by using the [] operators. the function
int fetchargs(char **argv){
argv[0][0] = \'A\';
char ** argv
is a pointer to a pointer of character(s) or a double pointer
Where as argv[ARG_NUM][MAX_LINE]
is essentially a 2D array of characters
char argv[ARG_NUM][MAX_LINE];
.........
.........
int fetchargs(char argv[][MAX_LINE]){
argv[0][0] = 'A';
return 0;
};
That's how you should pass it to the function because it isn't a char **
. You have to delete the ;
after the curly bracket.
/*Dim is your ARG_NUM and dim2 MAX_LINE*/
int fetchargs(int dim1,int dim2,char pass[][MAX_LINE]){
/*Some stuff*/
return 1;
}/*You've a semicolon here*/