Segmentation fault. passing extra parameters to function
I have a function declared like so:
PHP Code:
int func( int file_num, int a, int l, int g );
I decided to change this so it could accept another parameter:
PHP Code:
int func( int file_num, int a, int l, int g , int o);
and call the function like so:
PHP Code:
func(num_of_files, l, a, g, o)
However now, with that extra parameter, i get a segmentation fault.
There is a strcpy in this function, where i copy file/dir names to an array. That array gets passed to qsort, and then onwards to another function to be printed.
The array is declared like so:
PHP Code:
char Array[file_num][100]; /* probably not the best way, but il leae it for the moment */
when i take the strcpy function out, i dont get a core dump.
Are there common problems when passing more parameters to functions like im trying to do?
thanks