#include<iostream>using namespace std;int *findmax(int *array,int size,int *index);void main(){int a[]={33,23,78,99,54,45,76,12,90};int *maxaddr;int idx;maxaddr=findmax(a,sizeof(a)/sizeof(*a),&idx);cout<<"the index of maximum element is"<<idx<<endl;cout<<"the address of is"<<maxaddr<<endl;cout<<"the valve of is"<<a[idx]<<endl;}
想要調用findmax()函數,尋找數組中的最大元素,請問該怎樣定義函數?
慕婉清6462132
2022-04-15 15:11:21