Create new C++ object at specific memory address?

后端 未结 5 1335
悲&欢浪女
悲&欢浪女 2020-11-30 00:32

Is it possible in C++ to create a new object at a specific memory location? I have a block of shared memory in which I would like to create an object. Is this possible?

5条回答
  •  爱一瞬间的悲伤
    2020-11-30 00:58

    On Windows, MapViewOfFileEx and VirtualAllocEx allow one to specify a preferred virtual address. No guarantees though.

提交回复
热议问题