#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
double weights[11] = { 10.1, 11.2, 1.2, 4.5, 11.4, 11.5, 12.5, 10.4, 9.8, 7.6, 6.2 };
double *max_ptr = NULL;
double *current_ptr = weights;
int i;
for (i = 0; i < 11; i++, current_ptr++)
{
if (!max_ptr || (*max_ptr < *current_ptr))
max_ptr = current_ptr;
}
return 0;
}
Comments
Leave a comment