code
code
/* Function uses parameters passed by main to build and paste the char array.
For loop used for pushing back characters inside the pattern (char) array.
If statement used to only paste the whole array before the for loop completely ends.
*/
/*
Main function used to declare variables for the next function to use.
*/
int main()
{
int number;
char pattern[]{}; // declares an array
cout << "How many letters do you want in your pattern?" << endl;
cout << "(Pick a number from 2 - 20)";
cin >> number; // Puts user input inside of the number variable
if(number < 2 || number > 20) // Calls an error in case user enters an invalid number
{
cout << "Error: too high or low. Try again.";
return 0;
}