C++: myLength() zur Ermittlung der Arraylänge als Marko definieren

/*
 * MinMax.cpp
 *
 *  Created on: 19.01.2014
 *      Author: ottp
 */


#include 
#define myLength(x) sizeof(x)/sizeof(x[0])

using namespace std;

void minMax(int arr[], int l) {
	int min = arr[0];
	int max = arr[0];

	for(int i = 0; i < l; i++) {
		if(arr[i] < min) {
			min = arr[i];
		}
		if(arr[i] > max) {
			max = arr[i];
		}
	}

	cout << "Minimum: " << min << " Maximum: " << max << endl;
}
int main(int argc, char **argv) {

	int arr[] = {33, 44, 1, 5, 6, 100, 2355, 232, 121, 2445, 475};
	int l = myLength(arr);
	minMax(arr, l);
}