I am trying to print a text file out on screen using arrays, but I\'m not sure why it does not appear the way it is in the text file.
The text file:
you can do it like this
#include
int your_array[2][4] = {
{1,2,3,4},
{5,6,7,8}
};
using namespace std;
int main() {
// get array columns and rows
int rows = sizeof your_array / sizeof your_array[0];
int cols = sizeof your_array[0] / sizeof(int);
// Print 2d Array
cout << "your_array data "<
output
1
2
3
4
5
6
7
8