Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I allocate arrays or structures bigger than 64K?

arrays Bigger structures
0
Posted

How can I allocate arrays or structures bigger than 64K?

0

A reasonable computer ought to give you transparent access to all available memory. If you’re not so lucky, you’ll either have to rethink your program’s use of memory, or use various system-specific techniques. 64K is (still) a pretty big chunk of memory. No matter how much memory your computer has available, it’s asking a lot to be able to allocate huge amounts of it contiguously. (The C Standard does not guarantee that single objects can be 32K or larger, or 64K for C99.) Often it’s a good idea to use data structures which don’t require that all memory be contiguous. For dynamically-allocated multidimensional arrays, you can use pointers to pointers, as illustrated in questions 6.16 and 20.2. Instead of a large array of structures, you can use a linked list, or an array of pointers to structures. If you’re using a PC-compatible (8086-based) system, and running up against a 64K or 640K limit, consider using “huge” memory model, or expanded or extended memory, or malloc variants such

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123