You are here:

C++/Memory size of Arrays in C++

Advertisement


Question
Sir, I am working on a C program and sometimes need large sized arrays like A[1000][1000] far many variables and also sometime for 3 dimentional arrays. I am using Visual C++ and after a certain size it gets hanged. I tried to run on the Turbo C++ and it show an error of oversized array. Please let me know solution for my problem. I know some people were telling about dynamic programming but I am not too good in C programming and most of my programs are very simple coded ones. I really need help in this regard and will be very thankful for any suggestions to solve the problem.

Regards

Answer
Hi Arif

I can understand your problem pretty well coz once I have tried finding you the maximum memory that can be allocated and found out that max memory that can be allocated with a single call to calloc or malloc is the size of an unsigned integer so if you need to allocate memory beyond 64kb then you need to use interrupts but rather i would suggest you to use linked list in such a case, it would be a much safer and better practice for getting things done.

Please do feel free to get back to me in case if you have any doubt regarding the same.

regards
Joydeep Bhattacharya
http://www.scodz.com

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Joydeep Bhattacharya

Expertise

TSR, Socket and Very Complex Mathematical Problem

Experience

Worked on many OOP projects with design patterns

Organizations
http://www.scodz.com

Publications
http://www.scodz.com

Education/Credentials
Master of Computer Applications

Awards and Honors
Being a proud owner of a website of programming called http://www.scodz.com

Past/Present Clients
http://www.funforu.com http://www.dhoondho.com http://analysingc.50webs.com

©2016 About.com. All rights reserved.