// Linear search of an array. #include using std::cout; using std::cin; using std::endl; #include // contains function prototype for rand #include "searchArray.h" int main() { const int arraySize = 100; // size of array a int a[ arraySize ]; // create array a int searchKey; // value to locate in a for ( int i = 0; i < arraySize; i++ ){ // create some data a[ i ] = 1 + rand() % arraySize ; //cout<> searchKey; // attempt to locate searchKey in array a int element = linearSearch( a, searchKey, arraySize ); // display results if ( element != -1 ) cout << "Valore trovato nell'elemento " << element << endl; else cout << "Valore non trovato" << endl; return 0; // indicates successful termination } // end main