I'm pretty new to C++, and for a summer course we have to use a function to print a diamond, but we also need to let the user input a character to be used to create the diamond (so it can be made out of # or & instead, for example). I got my code to work, except it won't print out the symbol I'm inputting. Any suggestions?
void printChars (double number, char symbol){
int input;
number = input;
symbol = 1;
for (int i = 0; i < input; i++) {
for (int j = 0; j < number; j++) {
cout << " ";
}
for (int j = 0; j < symbol; j++) {
cout << symbol;
}
cout << endl;
number--;
symbol += 2;
}
for (int k = 0; k <= input; k++){
for (int l= 0; l < number; l++){
cout << " ";
}
for (int l = 0; l < symbol; l++)
cout << symbol;
cout << endl;
number++;
symbol -= 2;
}
}
int main () {
char symbol;
int input;
do {
cout << "Enter a symbol and a number between 3 and 10: ";
cin >> symbol >> input;
} while (input < 3 || input > 10);
printChars(symbol, input);
}