我可以增加一个静态分配的数组的大小? [英] Can I increase the size of a statically allocated array?

查看:129
本文介绍了我可以增加一个静态分配的数组的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道它能够增加一个动态分配的阵列的大小。

I know its possible to increase the size of a dynamically allocated array.

不过,我可以增加一个静态分配的数组的大小?
如果是的话,怎么样?

But can I increase the size of a statically allocated array? If yes,how?

编辑:虽然这个问题是针对C语言,考虑其他语言too.Is有可能在任何其他语言

Though this question is intended for C language, consider other languages too.Is it possible in any other language?

推荐答案

简单的答案是否定的,这不能完成。因此命名为静态。

Simple answer is no, this cannot be done. Hence the name "static".

现在,很多语言都有的东西,看起来像静态分配的数组,但实际上是静态分配到动态分配的数组引用。这些你可以调整大小。

Now, lots of languages have things that look like statically allocated arrays but are actually statically allocated references to a dynamically allocated array. Those you could resize.

这篇关于我可以增加一个静态分配的数组的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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