Hi, I'm new to C++ programming and this program basically needs to populate an array with integers from the user and display the array as part of a string. The catch is that I have to use specific functions given to me. However, one of them(populate_array() ) keeps bothering me to return a value but I don't know how to fix it. Any help would be much appreciated! Also, I have more functions to add later but my code for now is:
#include <iostream>
const int ArSize = 6;
void display_array(const double ar[], int n);
int populate_array(double ar[], int limit);
int main()
{
using namespace std;
cout << "This program takes integars and puts them into an array. They are later manipulated." << endl;
int array[6];
}
int populate_array(double ar[], int limit)
{
using namespace std;
for (int i = 0; i < 6; i++)
{
cout << "Please enter an integar: " << endl;
cin >> ar[i];
populate_array(ar, 6);
}
void display_array(const double ar[], int n);
{
cout << "The elements of the array are: " << display_array << endl;
}
}