I'm creating a program that fills arrays with random numbers, then sorts them in ascending and descending order. I have no problem with that. My question is, why am i getting errors that cout and cin are undeclared in my code. I try using #include <iostream>, but that gives me an even longer list of errors. Here's my code: (Thanks for reading)
Code:
#include <cstdlib>
#include <iomanip>
using namespace std;
const int SIZE = 200;
void initialize_array(int random_ints[], int num_elements, int bound);
int main(void)
{
int original_data[SIZE];
int copy_data[SIZE];
int num_values = 0;
int bound = 0;
cout << "Number of random data values in array (0-200)? ";
cin >> num_values >> endl;
cout << "Bound on maximum value? ";
cin >> bound >> endl;
return 1;
}
void initialize_array(int random_ints[], int num_elements, int bound)
{
int seed_value = 0;
cout << "Random seed value? ";
cin >> seed_value >> endl;
srand(seed_value);
for(int i = 0; i < num_elements; i++)
{
random_ints[i] = rand();
srand(random_ints[i]);
i++;
}
}