I wrote source code from reading but I have problem with it. So, it says, ""values is a two-dimensional array of floats with 10 rows and 20 columns. Write code that sums all the elements in the array and stores the sum in the variable total."
you have random blocks of code {} in your program, that is a dead giveaway of your programming level.
tip number 1) curly brackets "{}" begin only after function definitions, loops, and if statements. they don't appear randomly in code { like this }. I mean, I'm not sure if that's even legal in C++
@ TinyTeeTree: Yes, C++ supports this, they're called Anonymous Scopes. You use them when you want an object to exist only in a limited scope but you want the code in that scope to have access to the data that is already in that function.
mistake number 1)
you have a curly bracket starting at line 10, and ending at 23.
mistake number 2)
bad indentation.
a for loop performs only one statement after it, just because something is indented after a for loop doesn't mean that it will be part of that loop, if you get confused you need to write each for loop the standard way
1 2 3
for(int I=0; I<$; ++I){
//code
}
notice the brackets that follow the for loop? everything that goes between them will be part of the loop, if you denote brackets then the for loop captures only the next statement.
the funny thing is that the brackets in your code are correct, its the way you indented it that gives off that you don't know whats happening.
mistake number 3)
num.length and num[row].length
these things don't compile in c++. try again :)
mistake number 4)
the sum variable wasn't declared