How do I pass a single row of a 2 dimensionsl aarray to a function?

#include <iostream>
#include <iomanip>
#include <fstream>
#include <cstdlib>

using namespace std;


// ------ Prototypes ------------------------------------------------------
double calcNums(double[]);

// ****** MAIN ************************************************************
int main()
{
    double nums[2][5] = {1,2,3,4,5,6,7,8,9,10};

    calcNums(nums[1][5]);
  return 0;

}

double calcNums(double nums[1][5])
{
    double calc = 0;

  //  calc = nums[1] +  nums[2] + nums[3] + nums[4]  + nums[5];


    return calc;
}

I know my syntac is all wonkalicious, but I have no clue how to code this. (barring sending the entire row each time.)

So I did this:

// ------ Prototypes ------------------------------------------------------
double calcNums(double []);

// ****** MAIN ************************************************************
int main()
{
    double nums[2][5] = {1,2,3,4,5,6,7,8,9,10};

    calcNums(&nums[1]);
  return 0;

}

double calcNums(double nums[5])
{
    double calc = 0;

  //  calc = nums[1] +  nums[2] + nums[3] + nums[4]  + nums[5];


    return calc;
}

And it tells me that I cannot convert, er this:

D:\empty\empty.cpp||In function 'int main()':|
D:\empty\empty.cpp|28|error: cannot convert 'double ()[5]' to 'double' for argument '1' to 'double calcNums(double*)'|
||=== Build finished: 1 errors, 0 warnings (0 minutes, 0 seconds) ===|

You don't need the adress of operator (&) in your call to the 1D function.

Just use the array name and index of the row. That is the address of, or pointer to, the row in question.

calcNums(nums[1]);

Comments
Learned something new today :)

Thanks guys, it worked like a charm. posting the code on the off chance someone wants a reference:

#include <iostream>
#include <iomanip>
#include <fstream>
#include <cstdlib>

using namespace std;


// ------ Prototypes ------------------------------------------------------
double calcNums(double *a);

// ****** MAIN ************************************************************
int main()
{
    double nums[2][5] = {1,2,3,4,5,6,7,8,9,10};

    cout << calcNums(nums[1]);
  return 0;

}

double calcNums(double nums[5])
{
    double calc = 0;

    calc = nums[1] +  nums[2] + nums[3] + nums[4]  + nums[5];


    return calc;
}
This question has already been answered. Start a new discussion instead.