code_junkie

2d array error c++

Nov 12th, 2011
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. int myArray[10][10];
  2. for (int i = 0; i <= 9; ++i){
  3.  
  4. for (int t = 0; t <=9; ++t){
  5.  
  6. myArray[i][t] = i+t; //This will give each element a value
  7.  
  8. }
  9.  
  10. }
  11.  
  12. for (int i = 0; i <= 9; ++i){
  13.  
  14. for (int t = 0; t <=9; ++t){
  15.  
  16. cout << myArray[i][t] << "n";
  17.  
  18. }
Add Comment
Please, Sign In to add comment