我使用Rack::Test like提供的post方法发送一个多维数组
post "#{url}.json",:data => [["Company","Website"],["this is the dummy text, with,comma","www.technology.com"],["some company","www.url.com"]]
但是在我的控制器中,当我检查参数params[:data]时,我将它作为一维数组["Company",
有没有办法在不知道列数的情况下将多维数组传递给函数……我的意思是,假设我想打印一个多维数组,比如说a[][9]和b[][3]。如果我创建了一个公共函数,比如print。
// I have to specify the no of columns right and since
// the no of columns should be same for both actual and
// formal arguments
void print(int a[][])
我必须为不同的多维数组创建不同的函数。应该有一些绕过它的方法。
如何传递未绑定的多维数组?