I am learning array in C++. This code compiles but when I run the program, it gives some error. Is there anything wrong in this code?
When I run the exe file like this - Cpp1.exe > array.txt , nothing comes in to the array.txt and it says " Cpp1.exe has encountered a problem and needs to close. We are sorry for the inconvenience."Code:#include <iostream> using namespace std; int main() { int A[10][2]; for (int j=0; j<=10; j++) { for (int i=0; i<=2; i++) { A[j][i] = i+j; printf("A[%d][%d] = %d,\t",j, i, A[j][i]); } printf("\n"); } return 0; }




Reply With Quote
