| 编程中国 | 业界新闻 | 技术文章 | 视频教程 | 下载频道 | 程序源码 | 个人空间 | 编程论坛
全能ASP/PHP/ASP.NET主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付学习型 ASP/PHP/ASP.NET 主机 30元/年
高端软件开发 = 年薪十万不是梦   
共有 370 人关注过本帖
标题:帮忙翻译一下!
收藏  订阅  推荐  打印
打印

帮忙翻译一下!

帮忙翻译一下!

To write a function that has a two-dimensional array as an argument, you need to remember that the name of an array is treated as its address, so the corresponding formal parameter is a pointer, just as for one-dimensional arrays. The tricky part is declaring the pointer correctly. Suppose, for example, we start with this code:

int data[3][4] = { {1,2,3,4}, {9,8,7,6}, {2,4,6 8}};
int total = sum(data, 3);

What should the prototype for sum() look like? And why does the function pass the number of rows (3) as an argument and not also the number of columns (4)?
则sum()的原型是什么样的呢?函数为何将行数(3)作为参数,而将列数(4)作为参数呢?

感觉这个红色的部分翻译不对啊?

TOP

我觉得应该是:“而不将列数(4)作为参数呢?”

TOP

献丑了:
编写一个一二维数组为参数的函数,记住,数组的名字被看作是它的地址,所以相应的参数应该是一个指针,就像一位数组一样。该函数的技巧就是要正确地声明指针。比如,下面的代码:

那么,sun()的原型是什么样的呢?为什么函数只传递了三行这一参数,而不同时传递四列这一参数呢?

TOP

共有 369 人关注过本帖
发新话题
关于我们 | 广告合作 | 编程中国 | 清除Cookies | Archiver | WAP | TOP

编程中国 版权所有,并保留所有权利。鲁ICP备08000592号
Powered by Discuz, Processed in 0.046530 second(s), 9 queries.
Copyright©2004-2008, BCCN.NET, All Rights Reserved