错误:宏“pow”传递3个参数,但只需2个 [英] error: macro "pow" passed 3 arguments, but takes just 2

查看:144
本文介绍了错误:宏“pow”传递3个参数,但只需2个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我的程序有问题。它应该取两个数字并加注到另一个,但当我尝试编译程序时,我得到。

函数'power':

错误:宏" POW"通过3个参数,但只需要2

感谢您给予的任何帮助。

#include< stdio.h>

#include< tgmath.h>

int main(无效)

{

int x,n;

printf(" ;插入号码:");

scanf("%d"& x);

printf("插入号码将前一个号码提升为:" ;);

scanf("%d"& n);

int power(a10)

{

printf(" Value%d ^%d =%f",pow(x,n,));

}

}

解决方案

取消备用逗号:

 printf( 值%d ^%d =%f,pow(x,n,)); 
^
|



成为:

 printf(  Value%d ^%d =%f,pow(x,n)); 


hello everyone I'm having problems with my program. It is supposed to take two numbers and raise on to the other, but when I try to compile the program I get.
In function 'power':
error: macro "pow" passed 3 arguments, but takes just 2
thanks for any help given.
#include <stdio.h>
#include <tgmath.h>
int main(void)
{
int x,n;
printf("insert number: ");
scanf("%d",&x);
printf("insert number to raise previous number to: ");
scanf("%d",&n);
int power(a10)
{
printf("Value %d ^ %d = %f", pow(x, n,));
}
}

解决方案

Take off the spare comma:

printf("Value %d ^ %d = %f", pow(x, n,));
                                     ^
                                     |


Becomes:

printf("Value %d ^ %d = %f", pow(x, n));


这篇关于错误:宏“pow”传递3个参数,但只需2个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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