How can somebody increase the maximum size of an array?
Using TC, it appears the max is 64 KB.
Thanks for your help in advance.
How can somebody increase the maximum size of an array?
Using TC, it appears the max is 64 KB.
Thanks for your help in advance.
> How can somebody increase the maximum size of an array?
Get a compiler which isn't stuck in the stone age.
Why oh why do people still use this crap?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
it depends upon the memory capacity of the system. if there is no enough memory in the syystem then it throughs u an error telling segmenetation fault in gcc compile. no idea about the tc compiler. if you want to increase the array size in the run time better go to dynamic memory allocation..
nah, salem's right. you shouldn't be using turboC anymore. gcc is freely available.
"You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter
Turbo C creates 16-bit code. And what's 2^16? That's right, 64KB. As suggested by everyone else, get a new compiler.
If you understand what you're doing, you're not learning anything.
>Using TC, it appears the max is 64 KB.
You might try using the huge keyword:
But your best bet has already been suggested.Code:int huge array[size];
Last edited by swoopy; 01-25-2005 at 10:43 AM.
Thanks for all applicable responses and I'm sorry if my question wasn't smart enough.
By the way ,according to your advices I have searched on Internet for gcc compiler for hours and houres but I have encountered a lot of information that made me really mixed up.
According to some sites it seems I should first install some other requirements to work in DOS and I think understanding the concept of GNU is necessary for understanding gcc but what is it? And I finally didn’t understand the relation between gcc and linux.
Thanks for your patience!
Don’t forget I’m not software engineer so be patient while helping please.
Mehdi
http://faq.cprogramming.com/cgi-bin/...&id=1031248558
http://www.thefreecountry.com/compilers/cpp.shtml
http://compilers.net/
Most newbies get DEV-C++, which is the GNU compiler with a nice IDE (text editor, debugger) wrapped around it.
Once you've installed that, create a sample command line program
File->New->Project
choose the command line project type, and try this program
Then do Execute->Compile and Run and see what happens.Code:#include <stdio.h> int big[100000]; int main ( ) { printf( "Size of array is %lu\n", (unsigned long)sizeof big ); getchar(); return 0; }
Stop calling it DOS if your operating system is at least as good as windows 95.
For windows 95, 98, ME, you get a protected mode DOS emulator.
For NT, 2K, XP you get a console, who's similarity to DOS ends at the C:\> prompt.
> I think understanding the concept of GNU is necessary for understanding gcc
Not at all - you can use gcc quite happily without knowing anything about GNU
> And I finally didn’t understand the relation between gcc and linux.
Linux is an operating system, gcc is a compiler.
Most linux distributions come with gcc already installed.
gcc is used to compile the linux kernel from source code.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
> it depends upon the memory capacity of the system.
Erm, no it doesn't.
If you're running XP and using TC, then even if XP can see 1GB, TC is still stuck with 640K.
Now think back to when machines routinely had 512K of memory - try a museum.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.