If you look at your code, you get the value for the variable
length, which is passed to drawBar
cpp
int length = 0;
int character = 0;
cout << "Enter the triangle base size: ";
cin >> length;
But for your
userInput variable you never declare that variable, nor do you set it's value. In your
main method you should be declaring
userInput and getting/setting it's value, am I correct?
cpp
int main ()
{
//here you declare and set the value to
//be passed to the drawBar method, but
//nothing for printTriangle
int length = 0;
int character = 0;
//declare userInput
int userInput = 0;
cout << "Enter the triangle base size: ";
cin >> length;
//set the value for userInput
cout << "Enter the character to be printed:";
cin >> userInput;
return 0;
}
Another issue I see you could be having is you declare the
drawBar method with 2 parameters
cpp
void drawBar(int length, int character);
But when you define the method you have but 1 parameter
cpp
//Function Definitiion
void drawBar(int length)
{
for (int a = 1; a <= length; a++)
{
printTriangle(userInput);//This is where it is telling me it is wrong and this is the code I get: error C2065: 'userInput' : undeclared identifier
}
cout << endl;
}