-
-
Save shreezan123/88b6a1a5b6d6b546aea579d21f6ed748 to your computer and use it in GitHub Desktop.
Iterating 2d array in row major order
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int array [10000][10000]; | |
//Populating the 2d array | |
for (int i = 0; i< 10000; i++) | |
{ | |
for (int j = 0; j< 10000; j++) | |
{ | |
array[i][j] = i; | |
} | |
} | |
//Printing in row major order | |
for (int i = 0; i<10000; i++) | |
{ | |
for (int j = 0; j<10000; j++) | |
{ | |
cout << array[i][j]<<endl; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment