oh i used a function coz the array would be part of a larger program....
so...if i wanna print the array on screen now...i added in a few more lines....but the compiler gives me an error msg at line 21....
whats wrong there? i filled up both dimensions of the array, why cant it work?
You've declared 'col' inside the inner for loop. That means that when the loop is done, col is outside of scope.
To solve this problem you would have declare 'int col' in the same scope as where you use it. So right after this line : int a [MAXROW][MAXCOL]; for example. Just put a int col = 0; after it, and remove the 'int' delcaration from the for loop
:
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.