Hey guys.
None of my books tell me how to do this so im wondering if its even possible, but say i have an array like this:
Its it possible to calculate and find the total of only the top row?Code:int myArray[4][4] = { { 1,2,3,4 }, { 5, 6, 7, 8 }, { 7, 10, 11, 12 }, { 13, 14, 15, 16 } };
I know I can do it via an index like this:
But is there a simpler way to do that, as if I have a large array with say over 10Code:int totalRow = myArray[0][0] + myArray[0][1] ...etc
columns in size I really do not want to create a huge expression per row.
Any advice appreiciated guys![]()



LinkBack URL
About LinkBacks




