[enter image description here][1]I have a function void readline()
which output a string, and I want to pass it into another function as a parameter, how can I do that,
Thanks for any help.
int scorecount(argc1, argv1, void readline());
void readline();
int main(int argc, char *argv[]){
scorecount(argc,argv);
}
int scorecount(argc1, argv1, void readline()){
output a int
and I want to use the string from readline function somewhere in
scorecount
}
void readline(){
output a string
}
You can declare the parameter as the function declaration using any name of the parameter. For example
And the function
another_function
can be called likeThe compiler adjusts the function declaration to pointer to the function. So the above declaration is equivalent to
EDIT: After you updated your code then the function should be declared like
and called like