do dynamic allocation functions like malloc and so use the whole RAM and swap, or only 64k? the same about static allocation.
i migrated from pascal so...
do dynamic allocation functions like malloc and so use the whole RAM and swap, or only 64k? the same about static allocation.
i migrated from pascal so...
Two strings walk into a bar. The first one says, 'Bartender! Bartender! I want a drink!'. The second one says, 'Bartender! Bartender! I want a drink too! Blaaaaaaaaah eeeeeeeek yaaaaaaak oooooooh'. The first one says, 'Please excuse my friend. He isn't null term--'.
There isn't a limitation in the language itself on how big a chunk of memory you can allocate, other than what fits in the data type. Even that isn't the language saying "you can't allocate more", it's simply a limitation of the data type you pass as an argument to malloc or calloc.
If you have an old compiler, you're going to hit the 64K segment limitation, again due to the data type's size.
What you ask is really an OS / compiler specific question. The language doesn't limit you, other than what I've mentioned above. Since it doesn't, you've next got to look at the OS / hardware etc you're running on. If you only have RAM, and no swap, you're going to be limited by that. Otherwise, it'll potentially use both.
There are going to be some data segment size limitations you'll run into. These also are mainly due to the size of the data type itself. Dynamic allocation isn't going to have the same problem of running out of stack space and what not that you declaring an array would have.
I'm not an expert on the subject, so perhaps someone else will put it better than I have.
Quzah.
Hope is the first step on the road to disappointment.
64K?
What stone-age compiler are you using?
Get a 32 bit compiler, then your malloc will be able to access whatever the OS cares to give you by way of virtual memory.
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.
i'll happily get a new compiler but:
1. don't know a thing in win32 programming
2. i gennerally try to make dos/win16/unix/linux compliant progs.
3. borlandc is the only i have. all the results of google either are not free, either suck, either it's devcpp which doesn't work on my comp -- wonder why -- but the thing that mostly annoyes me is that i can't run a graphical linux (mouse not detected). i tried a gcc compile, but it had no header files, and just didn't know how to get them (what is the name of the package containing them)
Two strings walk into a bar. The first one says, 'Bartender! Bartender! I want a drink!'. The second one says, 'Bartender! Bartender! I want a drink too! Blaaaaaaaaah eeeeeeeek yaaaaaaak oooooooh'. The first one says, 'Please excuse my friend. He isn't null term--'.
1) You don't need to compile WinAPI programs to build programs which compile under Windows, if that's what you're using.
2) Sounds like you should get gcc then.
3) Search for cygwin. (Or just go to Cygwin.com...)
Quzah.
Hope is the first step on the road to disappointment.
> 1. don't know a thing in win32 programming
32 bit != win32
You can create 32 bit console programs without any difficulty.
http://www.thefreecountry.com/compilers/cpp.shtml
http://www.compilers.net/
> doesn't work on my comp -- wonder why
No idea - did you ever post a message asking why?
Did you ever consult the homepage FAQ?
> i tried a gcc compile, but it had no header files
Well locate the glibc (GNU 'C' library) which goes with it. The compiler is just that - a compiler. You need a bunch of header files and libraries to go with it.
Most Linux distro's should have that as part of the CD bundle.
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.
so, win32 means winapi and 32bit just means 32bit platform? interesting...
oh, i got a netinst debian so no wonder there was no library... stupid me
Two strings walk into a bar. The first one says, 'Bartender! Bartender! I want a drink!'. The second one says, 'Bartender! Bartender! I want a drink too! Blaaaaaaaaah eeeeeeeek yaaaaaaak oooooooh'. The first one says, 'Please excuse my friend. He isn't null term--'.