#include <iostream>
using namespace std;
int getDegree()
{
    int degree;
    cout << "Enter degree of polynomial" << endl;
    cin >> degree;
    return degree;
}
int* getPoly(int degree)
{
    cout << "Enter coefficients in order of power of x. e.g. for 2 + x + 3x^2, enter 2 then 1     then 3" << endl;
    int coeff [degree +1];
    for (int i = 0; i <= degree; i++)
    {
        cin >> coeff[i];
    }
    return coeff;
}
int* polyder(int p[], int degree)
{
    int dp[degree];
    for(int i = 0; i < degree; i++)
    {
        dp[i] = p[i+1] * (i+1);
    }
    return dp;
}
int main(int argc, const char * argv[])
{
    int degree = getDegree();
    int p = *getPoly(degree);
    int dp = *polyder(&p, degree);
    for(int i = 0; i < degree +1; i++)
        cout << "   " << p[i] << " x^" << i;
    cout << endl;
    for(int i = 0; i < degree +1; i++)
        cout << "   " << dp[i] << " x^" << i;
    cout << endl;
    return 0;
}
I am getting an error during the print statements. I am not worried about the math involved, just how to pass the arrays between functions/methods.
Can anyone find why this is not working? I am new to C++, used to Java.
 
     
     
    