gpt4 book ai didi

c - 为什么在引用具有越界索引的字符串时不会产生错误?

转载 作者:太空宇宙 更新时间:2023-11-04 02:34:00 25 4
gpt4 key购买 nike

<分区>

#include <stdio.h>

void removeString(char text[], int beg, int remove)
{
int index;

for(index = beg; text[index + remove] != '\0'; index++)
text[index] = text[index + remove];

text[index] = '\0';
}

int main(void)
{
char text [] = "the wrong son";
removeString(text, 3, 40);
printf("%s\n", text);
}

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