我如何传递一个多维数组给函数? [英] How can I pass a multidimensional array to a function?

查看:134
本文介绍了我如何传递一个多维数组给函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何传递一个多维数组在C函数/ C ++?

How can I pass a multidimensional array to a function in C/C++ ?

阵列的尺寸不会在编译时已知

The dimensions of array are not known at compile time

推荐答案

一个指针数组与尺寸沿开始 - 然后做函数中的数组运算是最常见的解决方案

A pointer to the start of the array along with the dimensions - then do the array arithmetic in the function is the most common solution.

或者使用提振

这篇关于我如何传递一个多维数组给函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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