working on a project on building a class called triangle and i'm having a tough time with a member function that draws the actual triangle
it is supposed to create an equilateral triangle with a border character and a fill character
here is my code that I'm using just for the equilateral triangle, i've made the triangle but have no idea how to make it fill with a character. can someone point me in the right direction?
int main()
{
const int size = 6;
const char border = '#';
const char fill = '*';
const char BLANK = ' ';
for (int i = 0; i < size; i++)
{
for (int k = 0; k < size - i; k++)
{
cout << BLANK;
}
for (int j = 0; j <= i; j++)
{
// if (() || ()) <---- condition that will make any outside character be a border ?
cout << border << BLANK;
// else
// cout << fill << BLANK; <---- makes all other characters fill?
}
cout << '\n';
}
}
any pointers will be greatly appreciated