Max size of Array

Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jun 2006
Posts: 98
Reputation: slacke is an unknown quantity at this point 
Solved Threads: 7
slacke's Avatar
slacke slacke is offline Offline
Junior Poster in Training

Max size of Array

 
0
  #1
Oct 10th, 2006
Hello

I'm working on an application.
I need as big arrays as possible. At home I work with linux there I can declare array as big as this: char buffer[1000000]. No probleme.

In work I'm working with boreland C++ 4.5 (WinXp) and I can't declare biger size of array as buffer[20000].
It tels me << constant is long << and << array size too large;

It is possible to change this? or Is there some reason to not declare bigger Arrays like this?

Please help...
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 275
Reputation: andor has a spectacular aura about andor has a spectacular aura about andor has a spectacular aura about 
Solved Threads: 29
andor's Avatar
andor andor is offline Offline
Posting Whiz in Training

Re: Max size of Array

 
0
  #2
Oct 10th, 2006
Originally Posted by slacke View Post
Hello

I'm working on an application.
I need as big arrays as possible. At home I work with linux there I can declare array as big as this: char buffer[1000000]. No probleme.

In work I'm working with boreland C++ 4.5 (WinXp) and I can't declare biger size of array as buffer[20000].
It tels me << constant is long << and << array size too large;

It is possible to change this? or Is there some reason to not declare bigger Arrays like this?

Please help...
I never worked with borland but probably U need to change the stack size in your compiler options. So go for help and find stack size. U can try also to declare the array as global becouse then its not using the stack.
If you want to win, you must not loose (Alan Ford)
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,661
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1500
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Max size of Array

 
0
  #3
Oct 10th, 2006
Depends on which version of that compiler is used -- 16-bit MS-DOS or 32-bit MS-Windows? 16-bit can create arrays up to only 64,000 bytes (large memory model), or 16,000 long integers. There is no work-around other than to redesign your program or use a modern 32-bit compiler, which is one reason MS-DOS is dead and buried.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,131
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 283
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: Max size of Array

 
0
  #4
Oct 10th, 2006
Borland 4.5 is a 16 bit compiler. Upgrade to Borland 5.5 for 32 bit.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,651
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 474
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: Max size of Array

 
0
  #5
Oct 10th, 2006
@ slake

Why stick to Borland ???
If you are thinking about compiler migration better go for the free Visual Studio 2005 free edition or for GCC mingw compiler which nowadays most of the people use.
I don't accept change; I don't deserve to live.

Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,131
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 283
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: Max size of Array

 
0
  #6
Oct 10th, 2006
Originally Posted by ~s.o.s~ View Post
Why stick to Borland ???
Why not? There's nothing wrong with the Borland compiler. It's when a bad compiler is in use you should change. But when you get right down to it, for the most part if it does the job, any compiler will do.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,651
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 474
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: Max size of Array

 
0
  #7
Oct 10th, 2006
Originally Posted by WaltP View Post
Why not? There's nothing wrong with the Borland compiler. It's when a bad compiler is in use you should change. But when you get right down to it, for the most part if it does the job, any compiler will do.
I didnt say anything is wrong with the compiler,my suggestions were purely based on personal choice, just wanted the OP to know the choices he has.

BTW since you seem to be a Borland proponent you might want to take a look here:
http://www.willus.com/ccomp_benchmark.shtml?p6
http://www.willus.com/ccomp.shtml?p03


Nothing personal, just found these when i was once looking for good compilers.
I don't accept change; I don't deserve to live.

Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 16
Reputation: peterbyrne is an unknown quantity at this point 
Solved Threads: 1
peterbyrne peterbyrne is offline Offline
Newbie Poster

Re: Max size of Array

 
0
  #8
Oct 10th, 2006
Cant imagine why you want to allocate all that space statically. Use another data structure which resides on the heap - a list perhaps.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,661
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1500
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Max size of Array

 
0
  #9
Oct 10th, 2006
boaland 5.5 and earlier have the same problem as VC++ 6.0 -- they are too old and do not support current C++ standards very well. And that is a big problem for new people who are trying to learn modern c++ with an ancient compiler. There are a few legatimate reasons I can think of for using those old compilers (such as support of legacy programs) but most people should be using newer compilers. when you say "they work" do you mean they work with code written in 2006 or code written in the 1980s and 1990s (10 years is a lifetime in the software and compiler industries!) The last time c++ standards were upgraded was in 1999 which is well after those borland and microsoft vc++ 6.0 compilers were produced.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 1,546
Reputation: Ene Uran has a spectacular aura about Ene Uran has a spectacular aura about 
Solved Threads: 174
Ene Uran's Avatar
Ene Uran Ene Uran is offline Offline
Posting Virtuoso

Re: Max size of Array

 
0
  #10
Oct 10th, 2006
Originally Posted by ~s.o.s~ View Post
@ slake

Why stick to Borland ???
If you are thinking about compiler migration better go for the free Visual Studio 2005 free edition or for GCC mingw compiler which nowadays most of the people use.
Why stick to Borland ??? Right on ~s.o.s~! Borland is a sinking ship!

The Visual Studio 2005 free edition is huge! Kind of takes over your computer. I would go for GCC which is part of the free Dev-C++ IDE.
drink her pretty
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum


Views: 11418 | Replies: 14
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC