memory allocation

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2004
Posts: 31
Reputation: dalaharp is an unknown quantity at this point 
Solved Threads: 0
dalaharp dalaharp is offline Offline
Light Poster

memory allocation

 
0
  #1
Dec 5th, 2004
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/.. :-|
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: memory allocation

 
0
  #2
Dec 6th, 2004
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 140
Reputation: anastacia is an unknown quantity at this point 
Solved Threads: 1
anastacia's Avatar
anastacia anastacia is offline Offline
Junior Poster

Re: memory allocation

 
0
  #3
Dec 6th, 2004
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
:lol: I am not one of those who wait for things to happen, :p but one of those who make things happen ;)
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 31
Reputation: dalaharp is an unknown quantity at this point 
Solved Threads: 0
dalaharp dalaharp is offline Offline
Light Poster

Re: memory allocation

 
0
  #4
Dec 7th, 2004
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........
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 140
Reputation: anastacia is an unknown quantity at this point 
Solved Threads: 1
anastacia's Avatar
anastacia anastacia is offline Offline
Junior Poster

Re: memory allocation

 
0
  #5
Dec 7th, 2004
so the only thing to do is use turco c++ modify the code. it is possiblle
:lol: I am not one of those who wait for things to happen, :p but one of those who make things happen ;)
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: memory allocation

 
0
  #6
Dec 7th, 2004
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?
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 140
Reputation: anastacia is an unknown quantity at this point 
Solved Threads: 1
anastacia's Avatar
anastacia anastacia is offline Offline
Junior Poster

Re: memory allocation

 
0
  #7
Dec 7th, 2004
you should have at least 1 reason 4 not being able to change your code;
:lol: I am not one of those who wait for things to happen, :p but one of those who make things happen ;)
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,362
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 242
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: memory allocation

 
0
  #8
Dec 7th, 2004
Originally Posted by dalaharp
is there no procedure wherein you can allocate memory by malloc etc..
Yes. What have you tried?
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 140
Reputation: anastacia is an unknown quantity at this point 
Solved Threads: 1
anastacia's Avatar
anastacia anastacia is offline Offline
Junior Poster

Re: memory allocation

 
0
  #9
Dec 7th, 2004
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
:lol: I am not one of those who wait for things to happen, :p but one of those who make things happen ;)
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 31
Reputation: dalaharp is an unknown quantity at this point 
Solved Threads: 0
dalaharp dalaharp is offline Offline
Light Poster

Re: memory allocation

 
0
  #10
Dec 8th, 2004
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..
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC