I'm at my wit's end here, my friends.

The purpose of this function is to take in a pointer to 2D array, a row number, and a column size and return the address that points to a specified row of values in a 2D array. I'm not sure how to accomplish this, any advice?

Thanks in advance.

```
double* get_row(double *the_array, int row_num, int col_size) {
cout << "Get Row : "<< the_array[row_num]<< "\n";
return the_array+row_num;}

```

The reason for the cout is to confirm that it's the right set of values I'm returning a pointer to but I'm not exactly sure I've implemented that correctly.

EDIT: 

Here is the full code

```
#include "TwoDArray.h"

using namespace std;

/*
 * 
 */

void set_row(double *the_array, int row_num, int col_size, double *row_vals) {
    for (int i = 0; i < col_size; i++)
        the_array[i] = *row_vals + i;
    cout << "Set Row:"<< *the_array << "\n";
}

double get_element(double *the_array, int row_num, int col_size, int col_num) {
    double thisElement = (*(the_array + (row_num * col_size)) + col_num);
    return thisElement;
}

double* get_row(double *the_array, int row_num, int col_size) {
    cout << "Get Row : "<< the_array[row_num]<< "\n";
    return the_array+row_num;
}

double sum(double *the_array, int row_size, int col_size) {

    double sum = 0.0;
    for (int j = 0; j < row_size; j++) {
        for (int i = 0; i < col_size * row_size; i++) {
            sum += the_array[i] + j;

        }
        return sum;
    }
}

double find_max(double *the_array, int row_size, int col_size) {
    double max_so_far = the_array[0];
    for (int j = 0; j < row_size; j++)
        for (int i = 0; i < col_size * row_size; i++)
            if (the_array[i] + j > max_so_far)
                max_so_far = the_array[i] + j;
    return max_so_far - 1;
}

double find_min(double *the_array, int row_size, int col_size) {
    double min_so_far = the_array[0];
    for (int j = 0; j < row_size; j++)
        for (int i = 0; i < col_size * row_size; i++)
            if (the_array[i] + j < min_so_far)
                min_so_far = the_array[i] + j;
    return min_so_far;

}

int main(int argc, char** argv) {

    const int row_size = 2; //i
    const int col_size = 3; //j
    double B[2][3] = {
        {68, 2, 44},
        {7, 8, 3}
    };
    double (*p)[3] = B;
    double C[2][3] = {
        {1, 1, 1},
        {1, 2, 3}};

    double (*f)[3] = C;

    cout << "\n" << "Sum of all Elements = " << sum(*p, 2, 3) << "\n"; ///Expected: 132
    cout << "\n" << "Get Element = " << get_element(*p, 1, 0, 0) << "\n"; //Expected: 68
    cout << "\n" << "Largest Element = " << find_max(*p, 2, 3) << "\n"; //Expected: 68
    cout << "\n" << "Smallest Element = " << find_min(*p, 2, 3) << "\n"; //Expected: 2
    cout << "\n" << "Get Row = " << get_row(*p, 0, col_size) << "\n"; //Expected: 2
    set_row(*p, 2, 3, *f);
    cout << "\n" << B[2][3];
    cout << "\n";

}

```