I'm getting an error "segmentation fault(core dumped)" for my program here, but everything in the program seems to be working fine. I understand what the error signifies I just cant identify what in my code is causing it. Any ideas?
#include <cmath> // for use of math functions
#include <iomanip> // for output display
#include "cosc1437_tk_1371133.h"
using namespace std;
//Global Constansts
const int ROWS = 3;
const int COLS = 10;
//Prototypes: None (other than defined in toolkit)
// MAIN program
int main()
{
// Hello Message
displayMessage("Hello. This program will demonstrate the use of 2D Arrays and mathematical operations.");
// Intialize and load arrays with flight information
int dArr[ROWS][COLS];
for (int i = 2; i < ROWS + 2; i++){
for (int j = 1; j < COLS + 1; j++) {
dArr[i][j] = pow(i, j);
cout << setw(8);
cout << dArr[i][j];
}
cout << "\n";
}
//Goodbye Message
displayMessage("Goodbye!");
}