Skip to content

wrong variable being compared #12

@Hallocoos

Description

@Hallocoos

Hi! Error I found in this function. https://github.com/jraleman/42_Exam-C/edit/master/level02/max.c

In this function, the while loop should be:
while (len--)
{
if (maxvalue < tab[i])
maxvalue = tab[i];
i++;
}
otherwise it only ends up comparing the last two integers in the array and returns the wrong result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions