February 11th, 2011, 02:09 AM
Beginners question about array in C++
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."
using namespace std;
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]);
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.