dimanche 29 octobre 2017

incompatible types in assignment of ‘double*’ to ‘double [10]’ [duplicate]

This question already has an answer here:

hey i a stuck at this and don't know where this is going wrong please help me i am getting this error incompatible types in assignment of ‘double*’ to ‘double [10]’
i am not understanding the concept of other answers please explain me

#include <iostream>

using namespace std;

double * extend(double price[],double quantity[],double amount[]){

    int i = 0;

    for(i = 0; i<10; i++){
        amount[i] = price[i] * quantity[i];
    }
    return amount;
}

int main()
{
    double x[10];
    double price[10] = {10.64,14.89,15.21,74.21,23.8,61.26,92.37,12.73,2.99,58.98};

    double quantity[10] = {4,8,17,2,94,61,20,78,55,41};

    double amount[10];

    x = extend(price,quantity,amount);


   return 0;
}

Aucun commentaire:

Enregistrer un commentaire