如何将动态多维数组传递给函数? [英] How can I pass a dynamic multidimensional array to a function?

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

问题描述

如何在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.

或使用 boost

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

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