Hint: Use a loop inside a loop to complete drawTriangle(). The outer loop is responsible for outputting the asterisk line, and the inner loop is responsible for building the asterisk line with the appropriate length by concatenating asterisks to a single string.
I didn't quite understand your answer... however... here you have a program which makes an equilateral triangle (not taken into account that the terminal isn't made of squares) made of asterisk lines.