标题:帮帮小女
取消只看楼主
舒琴
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2004-6-3
 问题点数:0 回复次数:0 
帮帮小女

我刚学的c语言 对这个程序很不了解 谁能帮我每一步都解释一下呢~? 谢谢拉~

/* Passing an array to a function. */

#include <stdio.h>

#define MAX 10

int array[MAX], count;

int largest(int num_array[], int length);

int main( void ) { /* Input MAX values from the keyboard. */

for (count = 0; count < MAX; count++) { printf("Enter an integer value: "); scanf("%d", &array[count]); }

/* Call the function and display the return value. */ printf("\n\nLargest value = %d\n", largest(array, MAX));

return 0; } /* Function largest() returns the largest value */ /* in an integer array */

int largest(int num_array[], int length) { int count, biggest = -12000;

for ( count = 0; count < length; count++) { if (num_array[count] > biggest) biggest = num_array[count]; }

return biggest; }

搜索更多相关主题的帖子: int array count MAX 
2004-06-09 02:30



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-2217-1-1.html




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

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