online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> using namespace std; bool findmin(int a, int b){ return (a<b); } bool findmax(int a, int b){ return (a>b); } int findMinMax(int a[], int n, bool (*comp)(int, int) = findmax ){ int MinMax=a[0]; for (int i=1; i<n; i++){ if (comp(a[i], MinMax)) MinMax=a[i]; } return MinMax; } int main() { int n, m; cout << "NM:"; cin >>n >>m; int A[m]; int B[n]; //int* A = new int[n]; //int* B = new int[m]; cout<<"A:"; for (int i=0; i<n; i++){ cin >>A[i]; } cout<<"B:"; for (int i=0; i<m; i++){ cin >>B[i]; } cout << findMinMax(A, n, findmin) <<endl <<findMinMax(B, m); return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue