for example
the length of letter W compared to letter l is much longer
and for * (asterisk) it has a fixed length
so length of * compared to letter l is longer...
So it means that you can't assign equal number of asterisk to the number of letters
Hmm...
possible solution is, if your using console...
I think you can use SetConsoleCursorPosition() in outputting the text and the asterisk.
void gotoxy(char passtext)
{
int i, j;
HANDLE hOut;
COORD Position;
CONSOLE_CURSOR_INFO info;
hOut = GetStdHandle(STD_OUTPUT_HANDLE);
for(i = 0; i < 39; i++){
Position.X = i; //set the position of x
Position.Y = 3; //set the position of y
SetConsoleCursorPosition(hOut, Position);
cout<<passtext[i];
}
for(j = 0; j < 39; j++){
Position.X = j; //set the position of x
Position.Y = 4; //set the position of y
SetConsoleCursorPosition(hOut, Position);
cout<<"*";
}
}
int main(){
char text[39] = {"Area of a circle program by Josh Hicks"};
gotoxy(text);
return 0;
}