I have some problems passing argument from bash file to C program. I'm using a bash script to compile C program like this:
gcc -O0 filec1.c -lm -o fileoutput
./fileoutput $1 $2 $3 $4 $5 $6 $7 $8 $9 $10 $11
Now if I print each argument in bash file adding these lines:
for i in $@; do
echo $i
done
each argument passed is correctly printed but if I print each argument in the c file that has just a main with the following lines:
int main(int argc, char **argv){
for(int i=0; i<argc; i++){
printf("%s\n", argv[i]);
}
}
the output for the arguments after 9th are wrong or not printed. Someone can help me please?