C,如果分配不能在原地增长,则重新分配失败 [英] C, realloc that fails if the allocation cannot grow IN PLACE

查看:67
本文介绍了C,如果分配不能在原地增长,则重新分配失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以在C中增长数组,但前提是可以在适当的位置增长内存(也就是说,如果需要更改指针,则不能增长)?

Is there a way to grow an array in C, but only if the memory can be grown in place (That is, fail to grow if the pointer needs to be changed)?

推荐答案

在标准C语言中,没有能够做到这一点的函数.

In standard C there is no function capable of doing that.

这篇关于C,如果分配不能在原地增长,则重新分配失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆