You seem to have a misunderstanding of how multidimensional arrays work. You can't simply leave the first size undefined in the local variable, you must give it a size. You are also deleteing the array even though you never used new with it, so you will have an issue there as well. I would suggest looking at this article: