Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • I know it makes no sense, the point was to illustrate what I wanted to do. I did take a look at mapping for C, and it seems that I have to hash to find the correct map in an array of mapping, yes? Commented Apr 30, 2019 at 0:46
  • There are different approaches. Hashing is probably the most common. "Sparse array" is a good search term for more research. As @tadman said in comments: 1024x1024 is not that expensive (perhaps don't put it on the stack) so whether you need to do some other data type or just allocate a big array is really your call. Commented Apr 30, 2019 at 0:53
  • I know it's normally no big deal to take up 4MB of memory, but I am working on OS, where on a 32-bit It only takes up 4mb per program running. But on a 64 bit I would need something like 2*2^25 int array Commented Apr 30, 2019 at 1:04
  • Well then looks like something like a sparse array is the way to go. Commented Apr 30, 2019 at 1:31