我们可以在函数调用中使用相同的函数 [英] Can we use same function within function call

查看:96
本文介绍了我们可以在函数调用中使用相同的函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

main()

{

消息(message());

}

无效消息( )

{

printf(\ nPraise worthy and C worthy is synonyms);

}



我尝试了什么:



尝试找出真正的问题。

main( )
{
message( message ( ) ) ;
}
void message( )
{
printf ( "\nPraise worthy and C worthy are synonyms" ) ;
}

What I have tried:

try to find out the real problem.

推荐答案

不是那样的:消息没有参数,所以你可以传递任何东西。

这将工作:

Not like that: message takes no parameters, so you can;t pass it anything.
This will work though:
int message(int i)
    {
    printf ("\nPraise worthy and C worthy are synonyms");
    }

int main()
    {
    message(message(1));
    }


这篇关于我们可以在函数调用中使用相同的函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆