本文介绍了需要立即帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 大家好, 我需要绝望的帮助 以下是问题所在: 我今天的问题是使用多维数组。 假设我有一个数组A [31] [130] [256] [256]这是一个4维 静态数组。 如何在动态声明后动态声明这个相同尺寸的相同数组和 我希望能够访问内容 数组与indiceslike我应该能够在 动态声明之后访问elemt A [23] [34] [56 ] [78]。这可能是 请帮助 现在请记住阵列的内存空间不是问题而且我 无法更改此数据结构 谢谢 解决方案 这是一个FAQ问题。常见问题解答可在< http://c-faq.com/> ;, 找到,您的问题是6.16。如果在阅读完答案并尝试实施解决方案以满足您的需求后,您就会遇到一个具体的问题, 返回到目前为止您所拥有的内容以及明确的描述其中 你的问题所在。 Robert Gamble 如果它是''相同的数组''那么它将具有相同的属性 是静态的,具有那些确切的固定尺寸。要求动态分配静态数组 ,或者分配一个具有确切固定尺寸的数组,这将是 a矛盾 with可变维度。 - 如果你撒谎到编译器,它将报复。 - Henry Spencer Hello all,I need desperate helpHere is the problem:My problem today is with multidimensional arrays.Lets say i have an array A[31][130][256][256] this is a 4 dimensionalstatic array.How will i declare this same array with same dimensions dynamically andalso after dynamic declaration i want to be able to access contents ofarray with indiceslike i should be able to access an elemt after afterdynamic declarartion asA[23][34][56][78].Is this possiblePlease helpNow pls remember that memory space for the array is not a concern and icant change this data structureThanks 解决方案This is an FAQ question. The FAQ can be found at <http://c-faq.com/>,your question is 6.16. If after reading the answer and trying toimplement the solution to fit your needs you have a specific question,come back with what you have so far and a clear description of whereyour problem lies.Robert GambleIf it is the ''same array'' then it would have the same propertiesof being static and with those exact fixed dimensions. It would bea contradiction in the question to ask to allocate a static arraydynamically, or to allocate an array with exact fixed dimensionswith variable dimensions.--If you lie to the compiler, it will get its revenge. -- Henry Spencer 这篇关于需要立即帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!