944,165 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 17295
  • C++ RSS
You are currently viewing page 1 of this multi-page discussion thread
Oct 10th, 2006
0

Max size of Array

Expand 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...
Similar Threads
Reputation Points: 14
Solved Threads: 7
Junior Poster
slacke is offline Offline
105 posts
since Jun 2006
Oct 10th, 2006
0

Re: Max size of Array

Click to Expand / Collapse  Quote originally posted by slacke ...
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.
Reputation Points: 251
Solved Threads: 29
Posting Whiz in Training
andor is offline Offline
274 posts
since Jun 2005
Oct 10th, 2006
0

Re: Max size of Array

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.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,963 posts
since Aug 2005
Oct 10th, 2006
0

Re: Max size of Array

Borland 4.5 is a 16 bit compiler. Upgrade to Borland 5.5 for 32 bit.
Moderator
Reputation Points: 3281
Solved Threads: 896
Posting Sage
WaltP is offline Offline
7,749 posts
since May 2006
Oct 10th, 2006
0

Re: Max size of Array

@ 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.
Super Moderator
Featured Poster
Reputation Points: 3241
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,873 posts
since Jun 2006
Oct 10th, 2006
0

Re: Max size of Array

Click to Expand / Collapse  Quote originally posted by ~s.o.s~ ...
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.
Moderator
Reputation Points: 3281
Solved Threads: 896
Posting Sage
WaltP is offline Offline
7,749 posts
since May 2006
Oct 10th, 2006
0

Re: Max size of Array

Click to Expand / Collapse  Quote originally posted by WaltP ...
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.
Super Moderator
Featured Poster
Reputation Points: 3241
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,873 posts
since Jun 2006
Oct 10th, 2006
0

Re: Max size of Array

Cant imagine why you want to allocate all that space statically. Use another data structure which resides on the heap - a list perhaps.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
peterbyrne is offline Offline
16 posts
since Oct 2006
Oct 10th, 2006
0

Re: Max size of Array

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.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,963 posts
since Aug 2005
Oct 10th, 2006
0

Re: Max size of Array

Click to Expand / Collapse  Quote originally posted by ~s.o.s~ ...
@ 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.
Reputation Points: 625
Solved Threads: 211
Posting Virtuoso
Ene Uran is offline Offline
1,704 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: C++
Next Thread in C++ Forum Timeline: multithreading & destructor call.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC