【发布时间】:2017-09-15 10:22:25
【问题描述】:
[在此处输入图片描述][1]我有一个函数void readline()输出一个字符串,我想将它作为参数传递给另一个函数,我该怎么做,
感谢您的帮助。
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
}
【问题讨论】:
-
您需要显示更多代码,您的问题在这里还不清楚。或者你可能需要阅读你的 C 教科书。
-
你是说readline会给你输出字符串,你想把它传递给另一个函数,readline函数的返回类型应该是“string”
-
也许你想要GNU readline,但它不会返回
void -
你为什么要链接到实际代码,并输入该代码的一些遥远的近似值?请阅读并在您的问题文本中提供minimal reproducible example。
标签: c parameters function-declaration