That is not the only error.
Code:
#include <stdio.h>
#include <stdlib.h>
void testfunc (int x,int len) {
printf("%d\n", x);
}
int main (int argc, char *argv[]) {
if (argc>2) testfunc(atoi(argv[2])); //This is wrong also
testfunc(len); // error function has been more arguments, but I need use it.
//You don't declare len
}
This is correct:
Code:
#include <stdio.h>
#include <stdlib.h>
void testfunc (int x,int len) {
printf("%d\n", x);
}
int main (int argc, char *argv[]) {
if (argc>2) testfunc(atoi(argv[2]), 3);
testfunc(2, 3);
}
But meaningless since you only use one parameter inside testfunc()
In any case in testfunc() blue parameters will be x and dark orange ones will be len