I am using borland C++ 3.1.
I am using the code below to display text (a array value) on a graphic screen. I know I am using the right function (sprintlf() ) but cannot get it to work right.
struct vertex_struct
{
int excess;
int height;
} vertex[10];
I want to display all 5 vertices on the screen:
char text_string[15];
for (int c=0; c<5; c++)
{
sprintf(text_string, "Vertex[%d] = %lf", c, vertex[c].excess);
outtextxy(300,400,text_string);
}
************************************************** ***
I would like the output to look like:
vertex[0] = 34.05
vertex[1] = 105.12
vertex[2] = 33.3
vertex[3] = 21.2
vertex[4] = 10
I know that I am not using sprintlf() correctly. Also the outtextxy () is not correct either because as it is, it just keeps writing to the same spot on the screen.
I have never used the sprintf function before, so it is giving me some problems.