gpt4 book ai didi

c - 移动实现

转载 作者:行者123 更新时间:2023-12-02 05:31:42 24 4
gpt4 key购买 nike

引用线程:memmove implementation in C ,我不明白为什么两个不同的变量会有内存重叠?即,这是编译器将相同的“公共(public)空间”分配给 2 个不同变量的正常情况吗?为什么编译器在这种情况下使用此策略?

最佳答案

与编译器无关。请考虑以下事项:

int x[100];

memmove(&x[1], &x[0], 99*sizeof(int));

关于c - 移动实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5054288/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com