473,386 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

ARRAY SIZE TOO LARGE

I want to use an array of size greater than ARRAY[256][256] but am
getting an array size too large error.
I am using a BC 3.1 on msdos ver 5.1.2600 on XP.
How can i get around this simple but irritating problem.

Sep 1 '06 #1
11 10974
shreesh wrote:
I want to use an array of size greater than ARRAY[256][256] but am
getting an array size too large error.
I am using a BC 3.1 on msdos ver 5.1.2600 on XP.
How can i get around this simple but irritating problem.
Please don't shout.

Array of what and in what context? If you hit an implementation limit
for automatic variables, try dynamic allocation.

--
Ian Collins.
Sep 1 '06 #2
well. my array context is as follows.

struct authors
{
char name[50];
int uniq_id;
}node[10000];

i am getting an array out of size error.
I tried using the huge decleration as follows.

struct authors
{
char name[50];
int uniq_id;
};
struct authors huge node[10000];

But then i a m having problems in accesing the structure elements.
Ex: printf("%s",node[0].name)
prints: ( null )
So am still stuck with the size limitation.

Is my way of accessing the individual structure elements correct??



Ian Collins wrote:
shreesh wrote:
I want to use an array of size greater than ARRAY[256][256] but am
getting an array size too large error.
I am using a BC 3.1 on msdos ver 5.1.2600 on XP.
How can i get around this simple but irritating problem.
Please don't shout.

Array of what and in what context? If you hit an implementation limit
for automatic variables, try dynamic allocation.

--
Ian Collins.
Sep 1 '06 #3

shreesh wrote:
well. my array context is as follows.

struct authors
{
char name[50];
int uniq_id;
}node[10000];

i am getting an array out of size error.
I tried using the huge decleration as follows.

struct authors
{
char name[50];
int uniq_id;
};
struct authors huge node[10000];

But then i a m having problems in accesing the structure elements.
Ex: printf("%s",node[0].name)
prints: ( null )
So am still stuck with the size limitation.

Is my way of accessing the individual structure elements correct??



Ian Collins wrote:
shreesh wrote:
I want to use an array of size greater than ARRAY[256][256] but am
getting an array size too large error.
I am using a BC 3.1 on msdos ver 5.1.2600 on XP.
How can i get around this simple but irritating problem.
>
Please don't shout.

Array of what and in what context? If you hit an implementation limit
for automatic variables, try dynamic allocation.

--
Ian Collins.
Sep 1 '06 #4
well. my array context is as follows.

struct authors
{
char name[50];
int uniq_id;

}node[10000];

i am getting an array out of size error.
I tried using the huge decleration as follows.

struct authors
{
char name[50];
int uniq_id;
};

struct authors huge node[10000];

But then i a m having problems in accesing the structure elements.
Ex: printf("%s",node[0].name)
prints: ( null )
So am still stuck with the size limitation.

Is my way of accessing the individual structure elements correct??

Sep 1 '06 #5
On 31 Aug 2006 23:10:13 -0700, "shreesh" <sh************@gmail.com>
wrote:
>well. my array context is as follows.

struct authors
{
char name[50];
int uniq_id;

}node[10000];

i am getting an array out of size error.
I tried using the huge decleration as follows.

struct authors
{
char name[50];
int uniq_id;
};

struct authors huge node[10000];

But then i a m having problems in accesing the structure elements.
Ex: printf("%s",node[0].name)
prints: ( null )
So am still stuck with the size limitation.

Is my way of accessing the individual structure elements correct??
Yes.

Try posting a complete example of your code that compiles, links, and
runs. Someone may be able to help you then, but be advised that "huge"
is non-standard C.

--
jay
Sep 1 '06 #6
shreesh wrote:
I want to use an array of size greater than ARRAY[256][256] but am
getting an array size too large error.
I am using a BC 3.1 on msdos ver 5.1.2600 on XP.
How can i get around this simple but irritating problem.
Use a decent compiler, or switch to heap allocated memory.

Igmar

Sep 1 '06 #7
Igmar Palsenberg wrote:
shreesh wrote:
>I want to use an array of size greater than ARRAY[256][256] but
am getting an array size too large error.
I am using a BC 3.1 on msdos ver 5.1.2600 on XP.
How can i get around this simple but irritating problem.

Use a decent compiler, or switch to heap allocated memory.
Don't be silly. There is no guarantee of over 32767 bytes
available in C90, nor of over 65535 available in C99.

--
Some informative links:
news:news.announce.newusers
http://www.geocities.com/nnqweb/
http://www.catb.org/~esr/faqs/smart-questions.html
http://www.caliburn.nl/topposting.html
http://www.netmeister.org/news/learn2quote.html
Sep 1 '06 #8

shreesh wrote:
I want to use an array of size greater than ARRAY[256][256] but am
getting an array size too large error.
I am using a BC 3.1 on msdos ver 5.1.2600 on XP.
How can i get around this simple but irritating problem.
BC 3.1 is probably a 16-bit address compiler, which limits arrays to
65536 bytes. And that's 256 x 256.

It's probably high time you move to a 32 or 64-bit compiler. BC 5.5 is
free and available from www.borland.com (if you can figure out their
unintuitive web site and links).

Even better, you can download Visual C from the Microsoft site.

Sep 1 '06 #9
"shreesh" writes:
>I want to use an array of size greater than ARRAY[256][256] but am
getting an array size too large error.
I am using a BC 3.1 on msdos ver 5.1.2600 on XP.
How can i get around this simple but irritating problem.
I see two possible ways to proceed. Type <huge msdosinto Google *groups*,
and see where it leads.

Get a new compiler if you don't need the ms-dos stuff. All good things
eventually end and it gets harder and harder to do things the old way. To
get up and running with the Dev-C download is fairly easy. Type in an
explicit file extender of .c when you assign a name to your source file and
the program will be compiled as a C program. I've never had much luck with
the debugger and the documentation is sparse, but other than that, no
problems.

http://www.bloodshed.net/dev/devcpp.html.
Sep 1 '06 #10
CBFalconer <cb********@yahoo.comwrites:
Igmar Palsenberg wrote:
>shreesh wrote:
>>I want to use an array of size greater than ARRAY[256][256] but
am getting an array size too large error.
I am using a BC 3.1 on msdos ver 5.1.2600 on XP.
How can i get around this simple but irritating problem.

Use a decent compiler, or switch to heap allocated memory.

Don't be silly. There is no guarantee of over 32767 bytes
available in C90, nor of over 65535 available in C99.
Of course there's no guarantee, but compilers are *permitted* to
support objects larger than the limits specified in the standard(s).
They're also permitted to support larger objects in some contexts than
in others (e.g., depending on storage duration).

Switching to a different compiler, or using malloc() rather than a
declared object, is a perfectly sensible thing to try, even though the
standard doesn't happen to guarantee that it will help.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Sep 1 '06 #11
Igmar Palsenberg wrote:
shreesh wrote:
>I want to use an array of size greater than ARRAY[256][256] but am
getting an array size too large error.
I am using a BC 3.1 on msdos ver 5.1.2600 on XP.
How can i get around this simple but irritating problem.


Use a decent compiler, or switch to heap allocated memory.

Igmar
On my compilers, declaring it static cures your problem.
An astro prog of mine uses a ~40 megabyte array this way.
Sep 1 '06 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Yaroslav Bulatov | last post by:
I made an array of 10 million floats timed how long it takes to sum the elements, here's what I got (millis): gcc -O2: 21 Python with numarray: 104 Python with Numeric: 302...
2
by: Developwebsites | last post by:
const int MAX=999; class person { protected: char firstname, lastname; int ID; public: person();
29
by: shmartonak | last post by:
For maximum portability what should the type of an array index be? Can any integer type be used safely? Or should I only use an unsigned type? Or what? If I'm using pointers to access array...
7
by: ultr | last post by:
I need a large 3D array of structures: struct s { char a; int b; }; s s_array; s_array is declared as global.
2
by: kaczmar2 | last post by:
I have code like so: FileStream fs = new FileStream(locationTextBox.Text, FileMode.Open, FileAccess.Write, FileShare.Read); long size = fs.Length; byte buffer = new byte; // Get file to byte...
2
by: ctj951 | last post by:
What I am trying to do is implement a associative array to lookup data based on a key in C. This might simple to do in C++ but I'm restricted to use C. The size of the data for the table isn't too...
1
by: Lorna | last post by:
I have a table on a form containing 2 columns - size type and size. Depending on the size type (Mens, womens, Youth) I want to change the set of sizes available (in an option box). I have been able...
5
by: =?Utf-8?B?QXlrdXQgRXJnaW4=?= | last post by:
Hi Willy, Thank you very much for your work. C++ code doesnot make any serialization. So at runtime C# code gives an serialization error at "msg_file_s sa = (msg_file_s) bf.Deserialize(ms);"...
3
by: =?Utf-8?B?SXpvcmljaA==?= | last post by:
I observed that WCF client running inside Full Trust mode XBAP application can't read byte array over 16384. If return result is bigger than that size, then client simply get null or Nothing in VB...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.