c++ - 错误 C2064。我已经尝试了我能想到的一切都没有成功

标签 c++

<分区>

error C2064: term 的计算结果不是带 1 个参数的函数

我已经尝试检查几乎所有内容,包括 double 和 int 定义,但我一直收到此错误。我检查了有关此错误的其他问题,但找不到任何内容。如果你们能帮助我,那就太好了。

// Bonus.cpp : main project file.

#include "stdafx.h"
#include <iostream>
#include <cmath>

using namespace System;
using namespace std;

double Per_Pay(double L, double r, double m, double t);
double After_Pay(double L, double r, double m, double t, double k);

int main()
{
int L,m,t,k;
double r;
cout << "Please input the values of L (the loan amount), r (the doubleerest rate per     year),\nm (the number of paymenst in a year), t (how many years the loan is for), and\nk (the amount of payments that have been made).\n\n";
cin >> L >> r >> m >> t >> k;
cout << "The amount to be payed each time is $" << Per_Pay(L,r,m,t) << " and the amount to be payed after " << k << " amount of payments is $" << After_Pay(L,r,m,t,k) << endl;
return 0;
}

double Per_Pay(int L, double r, int m, int t)
{
double R,i;
i=(r/m);
R=(L*i)/(1-(pow((1+i),(-m*t))));
return R;
}

double After_Pay(int L, double r, int m, int t, int k)
{
double R,L_prime,i;
i=(r/m);
R=(L*i)/(1-(pow((1+i),(-m*t))));
L_prime=R((1-(pow((1+i),(-m*t))))/i);
return L_prime;
}

最佳答案

double R,L_prime,i;
//....
L_prime=R((1-(pow((1+i),(-m*t))))/i);

让我们进一步削减它:

double R, L_prime;
L_prime=R(whatever);

问题很明显。 R 是变量,不是函数。更有趣的是您希望这段代码做什么。

关于c++ - 错误 C2064。我已经尝试了我能想到的一切都没有成功,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14467290/

相关文章:

c++ - 与用户构建的类似字符串类型的字符串比较

c# - 创建一个进程并重定向其输入/输出并且不继承套接字句柄

c++ - 基于范围的for循环的范围表达式使用const函数重载

c++ - 在没有锁的情况下创建 thread_safe shared_ptr 的正确方法?

c++ - vector 迭代器不兼容 : runtime error

c++ - Big-O函数分析,将字符串中的所有元音替换为一个字符

c++ - 如何使用相对路径切换到不同的驱动器

c++ - CMake + boost 测试 : ignore tests that fail to build

c++ - 用 boost::assign::list_of 初始化一个 std::vector<std::vector<int>>

c++ - 使用 C++ 删除 WMI 实例