Need help writing a 2D array for C++?

Follow
  • Follow publicly
  • Follow privately
  • Unfollow
This is what I am supposed to do: write a program that creates a two dimensional array initialized with test data. use any data type you wish. the program should have the following ...show more
Best Answer
This should help a little:

int getRowTotal(int** twoDimArray, int rowIndex, int width)
{
....int total = 0;
....for (int i = 0; i != width; ++i)
........total += twoDimArray[rowIndex][i];
....
....return total;
}

More information here:

http://www.cplusplus.com/doc/tutorial/ar...
  • Rate
  • Comment
Sign In 

to add your answer

No other answers

Who is following this question?

    %
    BEST ANSWERS
    Member Since:
    Points: Points: Level
    Total Answers:
    Points this week:
    Follow
     
    Unfollow
     
    Block
     
    Unblock