find0.cpp

We use cookies. Read the Privacy and Cookie Policy

find0.cpp

#include ‹stl.h›

#include ‹iostream.h›

int numbers[10] = {0, 1, 4, 9, 16, 25, 36, 49, 64};

int main() {

 int* location;

 location = find(numbers, numbers + 10, 25);

 cout ‹‹ "Found 25 at offset " ‹‹ (location - numbers) ‹‹ endl;

 return 0;

}