how to create an array for 15000 integers?

C

CBFalconer

jacob said:
You can't program on DOS without knowing those things.
Apparently you have forgotten how it was, or never used it.
I do remember how it was...

Amazing ignorance. I haven't even thought about such things for
quite a few years. I suggest you get and use DJGPP.
 
R

Richard Heathfield

jacob navia said:
You can't program on DOS without knowing those things.

Yes, you can. I did.
Apparently you have forgotten how it was, or never used it.
I do remember how it was...


Impossible to avoid them if you program under DOS.

Wrong. DOS hosts several conforming C compilers.
 
R

Richard Heathfield

CBFalconer said:
Amazing ignorance. I haven't even thought about such things for
quite a few years.

And even when you thought about them, you didn't need them for C
programming. If Mr Navia thinks a knowledge of memory models or near/far
pointers is necessary for writing C programs on a machine that just happens
to run MS-DOS, he's mistaken.
I suggest you get and use DJGPP.

Yes. Or, of course, Microsoft C, or Turbo C, or indeed any conforming
implementation of C that works on MS-DOS.
 
R

Richard Heathfield

Simon Biber said:

If you use the system that Chuck recommended under DOS, DJGPP, then you
won't be dealing with any tiny/compact/medium/large "memory models" or
any different types of pointers.

Nor will you if you use any other conforming C implementation, since C knows
nothing of such things.
 
S

Simon Biber

jacob said:
Simon Biber a écrit :
Right. You agree then with me that MSDOS is not really for learning,
what I was saying.

I agree that old 16-bit C compilers for MS-DOS are not good for learning
on. They tend to be buggy and not fully compliant to C89 let alone C99.
DJGPP is NOT dos, since, as you point out,

Let's not get into a silly and completely off-topic discussion of what
is DOS and what is not DOS. Programs compiled with DJGPP work on pure
MS-DOS as well as within the Windows NTVDM emulator (and other emulators
like DOSBox).

You just need the supplied CWSDPMI system, which is silently loaded when
your run the program, much like the MSVCRT.DLL or libc.so files are on
more advanced operating systems.
 
R

Richard Heathfield

Simon Biber said:

I agree that old 16-bit C compilers for MS-DOS are not good for learning
on. They tend to be buggy and not fully compliant to C89

That has not been my experience. There are enough compilers that are
sufficiently conforming for the purpose. I'm not claiming DOS would be my
first choice for learning C (although in fact it is the platform on which I
did learn it!), but it's good enough.
let alone C99.

Well, that's certainly true, but who uses C99? :)
 
R

Richard Bos

jacob navia said:
Mmmm... grasping the difference between the tiny/compact/medium/large
"memory models", making the difference between near and far pointers,

You make it more and more obvious that your experience with advanced
MS-DOS C implementations - DJGPP, in particular - is limited to having
once stood downwind of one.
For your futile information, none of what you mention need be used if
you compile with DJGPP.

Richard
 
R

Richard Heathfield

Richard Bos said:
You make it more and more obvious that your experience with advanced
MS-DOS C implementations - DJGPP, in particular - is limited to having
once stood downwind of one.
For your futile information, none of what you mention need be used if
you compile with DJGPP.

Nor with Turbo C, nor with Microsoft C...
 
C

CBFalconer

Richard said:
Simon Biber said:



That has not been my experience. There are enough compilers that
are sufficiently conforming for the purpose. I'm not claiming DOS
would be my first choice for learning C (although in fact it is the
platform on which I did learn it!), but it's good enough.

I use Turboc (2.01 I believe) to check that I haven't made
unwarranted assumptions about the sizeof(int). Available free from
the Borland museum. Now 17 years old.
 
A

ais523

jacob said:
Impossible to avoid them if you program under DOS.
Not true. I learnt C on DOS, using the C mode of the Borland C++
compiler. (Luckily, it's sufficiently well behaved to identify a file
ending .c as C rather than C++.) If you set the memory model to 'large'
(no need to change it from that setting, ever, while you're learning),
the pointers are all set to 'far' by default and the whole
implementation can be perfectly conforming to C89 with a couple of
extra compiler flags (which even change the implementation keyword
'far' to '__far' to prevent infringing on the user namespace). The
other memory models and near pointers can both be treated as
extensions, for use when you want to write smaller or more
memory-efficient programs; in this sense it's no different from the
extensions of other implementations.
 
D

Default User

Richard said:
Simon Biber said:



That has not been my experience. There are enough compilers that are
sufficiently conforming for the purpose. I'm not claiming DOS would
be my first choice for learning C (although in fact it is the
platform on which I did learn it!), but it's good enough.

I, like many I'm sure, cut my teeth on good old Turbo C. On the whole,
other than the somewhat clunky editor with the IDE, it was a pretty
good system.

I particularly liked the manual that came with it, the form was similar
to man pages, except that they didn't group functions. I prefered that.
I used the manual for a long time after I stopped using the compiler,
to the point where it completely fell apart.



Brian
 
R

Randy Howard

jacob navia wrote
(in article said:
You can't program on DOS without knowing those things.

You absolutely can.
Apparently you have forgotten how it was, or never used it.
I do remember how it was...

I remember how it was long before there was DOS. You're full of
it. writing tricky TSR code under DOS is one thing. Writing
standard C code is quite another, and very doable without such
knowledge.
Impossible to avoid them if you program under DOS.

Totally false.
 
J

jacob navia

Richard Bos a écrit :
You make it more and more obvious that your experience with advanced
MS-DOS C implementations - DJGPP, in particular - is limited to having
once stood downwind of one.
For your futile information, none of what you mention need be used if
you compile with DJGPP.

Richard

This thread (I repeat) was about MIRACL C.

OK?

I am referring to THAT environment guys, and I do not care
about the wonderful DJGPP since the original poster
doesn't use it!

I knew everything about DOS extenders, when I used them.
I have forgotten everything about thme since I do not use
them any more. But this is off topic for this thread.

To refresh your minds here is the original question I
was answering to:

< QUOTE >
I need to do an array with around 15000 integers in it.
I have declared it as unsigned letter[13000];
But the compiler is saying that this is too much.
How can I create an array for 15000 integers?

I am using "Miracle C compiler".

This is the error i am recieving:

"c:\documents and settings\david\desktop\asdasdasdasdasdasdasdad22.c:
line 6: too many locals declared
'unsigned letter[15000]'
aborting compile"

< END QUOTE>

MANY problems like this will appear when you use PLAIN OLD MSDOS
as this user is seeing. Those questions are difficult to
answer for a beginner so I recommended a modern environment where
those problems do not appear immediately.

This problems WILL appear eventually since if you replace 15000
with 15000000000 then the 32 bit implementation will
have the same problem, but when the student needs
15000000000 then it is (hopefully) more advanced :)
 
M

Mark McIntyre

This thread (I repeat) was about MIRACL C.

Repeat all you like, but this thread was about "how to create an array
for 15000 integers?".
"c:\documents and settings\david\desktop\asdasdasdasdasdasdasdad22.c:

MANY problems like this will appear when you use PLAIN OLD MSDOS

The line above your comment proves that he is *not* using plain old
MSDOS. However I suspect you will disagree about that so ILTAAEFTR.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
C

CBFalconer

jacob said:
.... snip ...

I need to do an array with around 15000 integers in it.
I have declared it as unsigned letter[13000];
But the compiler is saying that this is too much.
How can I create an array for 15000 integers?

Either declare it as static, or as file scope, or assign the space
with malloc.
 
T

Tom

I had a similar problem before and the good folks in here listened to
my silliness about ram disks and then one realized my error and
directed me towards malloc(). When you use malloc() you do not exceed
your program's image size limitations and other limits as well. I now
load various data files in their entirety and the speed enhancement of
re-reading the data repeatedly is sweet. For example: 20+ years of US
T-bill ticks with contract tags is one file of 181,000+ KB of data
that is opened at the same time as a statistical data file with a size
of 159,000+ KB. Both of these files are composed of binary structures
and are treated like huge arrays with simple indexing. malloc() works
miracles at times. :)
 
R

Richard Bos

jacob navia said:
Richard Bos a écrit :

This thread (I repeat) was about MIRACL C.

Even if that were true - which it isn't - that would not be any excuse
for you to make sweeping, false, and off-topic generalisations about the
platform that implementation runs on. Which is precisely what you did in
your very first post to this thread.

Richard
 
K

Keith Thompson

jacob navia said:
Richard Bos a écrit :

The original poster wrote


But obviously you can't read.

Obviously the fact that the original poster mentioned that he's using
a particular compiler does not necessarily imply that the thread is,
or should be, about that compiler.

The original poster also wrote (or his news software wrote on his
behalf):
> Newsgroups: comp.lang.c

We may reasonably infer from this that the thread is about C.
 
K

kjm.2me

I think it would be possible, if make your array with a file.

At first divide the array to some parts.

And make sure only a using bit of the array loaded to a main memory.

I hope that everything will be fine....

Jong-Min Kim.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top