| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 719 人关注过本帖
标题:帮忙翻译一下!
只看楼主 加入收藏
tymstill
Rank: 1
等 级:新手上路
帖 子:31
专家分:0
注 册:2008-1-28
结帖率:100%
收藏
 问题点数:0 回复次数:2 
帮忙翻译一下!
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)作为参数呢?

感觉这个红色的部分翻译不对啊?
搜索更多相关主题的帖子: 翻译 
2008-04-14 14:56
jackie_wyx
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2008-4-7
收藏
得分:0 
我觉得应该是:“而不将列数(4)作为参数呢?”
2008-04-14 15:25
toidy
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2008-4-6
收藏
得分:0 
献丑了:
编写一个一二维数组为参数的函数,记住,数组的名字被看作是它的地址,所以相应的参数应该是一个指针,就像一位数组一样。该函数的技巧就是要正确地声明指针。比如,下面的代码:

那么,sun()的原型是什么样的呢?为什么函数只传递了三行这一参数,而不同时传递四列这一参数呢?
2008-04-14 15:43
快速回复:帮忙翻译一下!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011748 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved