I'm learning how to program with C and I have a problem that I have never had before and don't know how to solve. I hope someone will be able to help me out.
I did this program:
PHP Code:
#include <stdio.h>
int findMax(int[], int ); /* prototype*/
int main()
{
int nums [10][20], i, j;
for (i=0; i < 200; ++i);
for (j=0; i < 200; ++j);
nums[i][j] = 2*i;
printf("The maximum value is %d \nin row $i column $j", findMax(*nums, 200), i, j);
return 0;
}
int findMax(int vals[], int numEls) /*find the maximum value*/
{
int i, *nums, max = vals [0];
for (i=1; i < 200; ++i);
if (max,vals[i])
max = vals[i];
return(max);
}
When I run debug on my complier it gives me the following message that I have never encountered before:
PHP Code:
Windows has triggered a breakpoint in Assignment 4A-2-a.exe.
This may be due to a corruption of the heap, and indicates a bug in Assignment 4A-2-a.exe or any of the DLLs it has loaded.
The output window may have more diagnostic information
I understand that I must have something not completely right but can't figure out what? COuld you guys help me out.
Thanks.