Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有人为内存中重叠的数组切片实现了交集?算法[]在没有重叠时返回。
[]
当漂亮打印(使用重叠缩进)在内存中重叠的数组切片时,我想要这个。
如果您确定它们是数组,那么只需获取ptr字段的差异:
ptr
size_t startoffset = b.ptr-a.ptr