Solved

How do I create an array of greater than 64k under Turbo C 2.0?

Posted on 2002-07-02
6
802 Views
Last Modified: 2007-12-19
I use Turbo C 2.0 and Dos 6.22

I found this on http://community.borland.com/.

>Allocating more than 64K of data in a single modul - by Borland Developer Support Staff

> Technical Notes Database

>TN2890C.txt   Allocating more than 64K of data in a single modul
>Category   :C
>Platform   :All
>Product    :TC  1.0

>Description:
>QUESTION:
>Can I statically allocate more than 64K of data in a single module?
>ANSWER:
>Yes. Far data items are now supported:
>...
>char far array1[60000L];
>char far array2[60000L];
>...
>For arrays larger than 64k use:
>char huge array3[100000L];

>Reference:

>7/2/98 10:43:08 AM

>Products:
>Turbo C/C++ 1.0

>Platforms:
>DOS 1.0; Windows 3.1 1.0

>Article ID: 17890   Publish Date: July 02, 1998  Last >Modified: September 01, 1999


But I always get two compiling errors,

"Conflicting type modifiers"
"Array Size too large"

How do I create an array of greater than 64k under Turbo C 2.0?

Thanks a lot!

BTW, I also found this in http://community.borland.com/article/0,1410,18117,00.html

>Q. How do I create an array of greater than 64k?
>A. See TI1563.ZIP in library 2

It's only a index. I can't find the file TI1563.ZIP. Could anyone can email a copy to me.
0
Comment
Question by:Jerryleo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 1

Expert Comment

by:laax
ID: 7126276
You can get the .zip file in the follwing URL
http://www.tietovayla.fi/BORLAND/CPLUS/c_tech.htm
0
 

Author Comment

by:Jerryleo
ID: 7126411
Allocating data >64k using the keyword huge

ftp://ftp.borland.com/pub/techinfo/techdocs/language/cpp/bcpp/ti/ti1563.zip

I am sorry. It's a broken URL.

RETR /pub/techinfo/techdocs/language/cpp/bcpp/ti/ti1563.zip
Wed Jul 03 16:32:31 2002 550 No such file.
Wed Jul 03 16:32:31 2002 RETR pub/techinfo/techdocs/language/cpp/bcpp/ti/ti1563.zip
Wed Jul 03 16:32:31 2002 550 No such file.
0
 

Author Comment

by:Jerryleo
ID: 7129101
Is there anyone can give me a example about allocating data >64k using the keyword huge under Turbo C 2.0?

Thanks a lot!
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Expert Comment

by:laax
ID: 7129144
I don't have the environemnt i.e Dos and Turbo C 2.0
...Please try "huge char" ...instead of "char huge"...
Type modifiers comes first, data type next...for ex.
'unsigned' long
'long' int
etc.
0
 

Author Comment

by:Jerryleo
ID: 7129181
Thanks for reply.

I have put the type modifiers comes first, like huge char, but I get a "Declaretion syntax error".
0
 
LVL 1

Accepted Solution

by:
laax earned 50 total points
ID: 7129214
Hi,

Why don't you use 'char *' instead of 'char huge'?

Declaration:
char *array3;

Allocate Memory:
  array3 = (char*) malloc ( sizeof(char) * 100000 );
  if ( array3 == null ) {
    // There is no more free memory to allocate
    // Handle this case here...
  }
and usage is same as before...

    array3[index] = something;
    and
    something = array3[index];

and finally write
    if ( array3 != null )
        free(array3);
Laax.
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question