I define a function
int find(char *t, int len){
}
then i call it with
value = "hello world";
rt = find(value, strlen(value));
it does not work, and show "error: too many arguments to function ‘find’"
I define a function
int find(char *t, int len){
}
then i call it with
value = "hello world";
rt = find(value, strlen(value));
it does not work, and show "error: too many arguments to function ‘find’"
int find(char *t, int len){
}
might give a warning that function should return a value.
and if you add:
char* value = "hello world";
int rt = find(value, strlen(value));
It should work fine if the code is in a single file (as already pointed by Michael in comments) else you will have to specify the prototype of find function before calling it from a separate file.
There is a syntax error in your call, no ; after value = "hello world"
Did you #include <string.h>?
This error might occur when there is difference in arguments between function declaration and function definition.
There are two errors that I found in the above code .
You have to mention the 'return' keyword at the end of the function definition .
You have to declare the character pointer (char * value) while initialize the 'value' .