<分区>
我有这个代码:
#include<stdio.h>
#include<iostream>
double PVfut(int n, int r)
{
double P[n];
for(int m=0;m<n;m++){
cout<<"Value:"<<endl;
cin>>P[m];
}
double PV;
double p;
for(int m=0;m<n;m++){
p*=(1+r);
PV+=P(m)/(p);
}
}
main(){
cout<<PVfut(2,2)<<endl;
}
我在调用 PVfut
时遇到错误,指出 &P 不能用作函数
。
问题是什么?