How to handle an array with size 1,000,000,000 in C++?

后端 未结 3 1568
夕颜
夕颜 2021-01-06 06:38

I need to handle 3D cube data. Its number of elements can be several billions. I understand I can\'t allocate that much memory on Windows. So I am thinking disk-based operat

3条回答
  •  爱一瞬间的悲伤
    2021-01-06 07:10

    try VirtualAlloc from .

    https://msdn.microsoft.com/en-us/library/windows/desktop/aa366887%28v=vs.85%29.aspx

    its quite useful for large arrays as long as they fit in your RAM, after that 0xC0000022L's answer is probably the better solution

提交回复
热议问题