// We are prompting the user to input a char, and
// an integer which will be the number of times the
// char repeats.
#include <iostream>
#include <iomanip>
usingnamespace std;
void StarRepeat(int n, char c) {
if (n > 0){
int counter =0;
while(counter < n-1) {
cout << c << ' ';
counter++;
}
cout << c;
}
cout << endl;
return;
}
int main(){
int n {0};
char c;
cout << "Character:" << endl;
cin >> c;
cout << "Repeat:" << endl;
cin >> n;
StarRepeat(n,c );
return 0;
The code itself is fine. It looks like you're trying to pass "-lab06" as an argument to your compiler (presumably GCC), which probably isn't what you want. Check what you're passing as command-line arguments when compiling/linking.