By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,364 Members | 1,691 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,364 IT Pros & Developers. It's quick & easy.

double to double error in c++

P: 3
I am getting a (cannot convert double to double in assignment errors) here is a part of my code

#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
#define MaxSize 1000

double loancalc (double *months, double *intrat, double *princ, double calcprnc[], double calcpay[], double calcbal[], double calcnew[], double calcInt[]);
double display (double *months, double calcprnc[], double calcpay[], double calcbal[], double calcnew[], double calcInt[]);


main ()
{
double mnths;
double *months;
months = mnths;
double ints = .09;
double *intrat;
intrat = ints;
double prin = 10000;
double *princ;
princ = prin;
double calcprnc[MaxSize], calcpay[MaxSize], calcInt[MaxSize];
double calcbal[MaxSize], calcnew[MaxSize];
int choice;
Aug 3 '07 #1
Share this Question
Share on Google+
2 Replies


10K+
P: 13,264
I am getting a (cannot convert double to double in assignment errors) here is a part of my code

#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
#define MaxSize 1000

double loancalc (double *months, double *intrat, double *princ, double calcprnc[], double calcpay[], double calcbal[], double calcnew[], double calcInt[]);
double display (double *months, double calcprnc[], double calcpay[], double calcbal[], double calcnew[], double calcInt[]);


main ()
{
double mnths;
double *months;
months = mnths;
double ints = .09;
double *intrat;
intrat = ints;
double prin = 10000;
double *princ;
princ = prin;
double calcprnc[MaxSize], calcpay[MaxSize], calcInt[MaxSize];
double calcbal[MaxSize], calcnew[MaxSize];
int choice;
Read your error messages. They do not say double to double. After that if you go to the line numbers they are pointing to, you should be able to see why the compiler is complaining.
Aug 3 '07 #2

Expert 10K+
P: 11,448
Expand|Select|Wrap|Line Numbers
  1.      double mnths; 
  2.      double *months; 
  3.      months = mnths;  
  4.  
*ahem* there they are; but what I find more frightening are those functions taking
an entire sweep of parameters. Shouldn't these parameters be somewhere in a
class object so your function can politely ask for the values, given an object of
that class as a single parameter?

kind regards,

Jos
Aug 3 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.