944,051 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 4114
  • C RSS
You are currently viewing page 1 of this multi-page discussion thread
Dec 5th, 2004
0

memory allocation

Expand Post »
hi,

in turbo C the maximum array size i am able to specify is array[250][250]..
what should i do to enlarge this size to say..array[512][512]..
i dont know a thing about memory allocation,
so please help me out/.. :-|
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
dalaharp is offline Offline
31 posts
since Oct 2004
Dec 6th, 2004
0

Re: memory allocation

Turbo C is a very old DOS compiler.
250*250 just happens to be very near the maximum value for a 16 bit unsigned int which is what under DOS is used as a pointer.

Use a 32 bit compiler if you want to allocate larger arrays.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Dec 6th, 2004
0

Re: memory allocation

WAT YOU CAN DO IS JUST LIKE SUGESTED USE A NEWST COMPILER AND CHANGE YOUR DATA TYPE OF YOUR ARRAY. LIKE IF IT WAS INT ARRAY CHANGE IT TO long int array[] or unsigned long int array[];
hope i have helped you out.
any more queries just post it here or pm any of us
Reputation Points: 11
Solved Threads: 1
Junior Poster
anastacia is offline Offline
142 posts
since Nov 2004
Dec 7th, 2004
0

Re: memory allocation

hi,
is there no procedure wherein you can allocate memory by malloc etc..
my whole code is in TorboC and i cant change it to another compiler.(atleast now)..

thanks........
Reputation Points: 10
Solved Threads: 0
Light Poster
dalaharp is offline Offline
31 posts
since Oct 2004
Dec 7th, 2004
0

Re: memory allocation

so the only thing to do is use turco c++ modify the code. it is possiblle
Reputation Points: 11
Solved Threads: 1
Junior Poster
anastacia is offline Offline
142 posts
since Nov 2004
Dec 7th, 2004
0

Re: memory allocation

why can't you use another compiler?
Cost can't be an issue as there are several modern compilers available free of charge.
Or are you stuck on a machine running DOS?
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Dec 7th, 2004
0

Re: memory allocation

you should have at least 1 reason 4 not being able to change your code;
Reputation Points: 11
Solved Threads: 1
Junior Poster
anastacia is offline Offline
142 posts
since Nov 2004
Dec 7th, 2004
0

Re: memory allocation

Quote originally posted by dalaharp ...
is there no procedure wherein you can allocate memory by malloc etc..
Yes. What have you tried?
Team Colleague
Reputation Points: 2780
Solved Threads: 312
long time no c
Dave Sinkula is offline Offline
4,790 posts
since Apr 2004
Dec 7th, 2004
0

Re: memory allocation

there is a procedure. the problem is that i cant teach u that coz i myself didnt qiute understand it. i saw that in a book sooo .. maybe somebody else CAN GIVE U A HELPING HAND
Reputation Points: 11
Solved Threads: 1
Junior Poster
anastacia is offline Offline
142 posts
since Nov 2004
Dec 8th, 2004
0

Re: memory allocation

Quote originally posted by jwenting ...
why can't you use another compiler?
Cost can't be an issue as there are several modern compilers available free of charge.
Or are you stuck on a machine running DOS?
i am using Turbo C 3.0, when you say another compiler, what do you mean,
can you name some good free downloadable ones..
Reputation Points: 10
Solved Threads: 0
Light Poster
dalaharp is offline Offline
31 posts
since Oct 2004

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: Encoding/Decoding
Next Thread in C Forum Timeline: Scanf problem





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


Follow us on Twitter


© 2011 DaniWeb® LLC