index

void index(double *first, double *last, int *indx)

Indexes the elements in [first, last) and places the index values in [indx, indx + (last - first)). The input elements of [first, last) are not changed.

Parameters:
firstBeginning iterator for the container of elements.
lastEnding iterator for the container of elements.
indxBeginning iterator of the index container.

Returns:
On return, the elements of [first, last) are replaced with thier indexes.

Usage:

double x[] = {2.0, 1.0, 3.0, 5.0, 4.0, 5.0};
int y[6];
index(x, x + 6, y);

Header:
#include "ranking.h"