作为一项任务,我必须编写一个接受用户输入的代码,并对它们执行操作,然后将它们打印到屏幕上。但是,我不断收到第18行的错误信息,其中我称FunctionMultiply为函数不能将'double(_cdecl *)()'转换为'double'。我搜索了这种类型的问题,但似乎所有这些都与我的代码中没有的数组有关。我怎样才能解决这个问题?无法将'double(_cdecl *)()'转换为'double'
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <ctype.h>
int GetInt(void);
double GetDouble();
char GetLetter(void);
double FunctionMultiply(int, double);
int FunctionCharacter(char);
int main()
{
GetInt();
GetDouble();
GetLetter();
FunctionMultiply(GetInt, GetDouble);
FunctionCharacter(GetLetter);
printf("%f", FunctionMultiply);
printf("%c", FunctionCharacter);
return 0;
}
int GetInt(void)
{
int integer;
printf("Enter an integer\n");
scanf("%i", &integer);
return integer;
}
double GetDouble()
{
double dub;
printf("Enter a floating point number\n");
scanf(" %lf", &dub);
return dub;
}
char GetLetter(void)
{
char letter;
printf("Enter a letter\n");
scanf(" %c", &letter);
return letter;
}
double FunctionMultiply(int arg1, double arg2)
{
double product = arg1 * arg2;
return product;
}
int FunctionCharacter(char letter)
{
if (toupper(letter) <= 'M')
{
return 0;
}
else
{
return 1;
}
}
FunctionCharacter(GetLetter()); –
[mcve]会更容易 – anatolyg