0

for(i=1;i<10;i++)
{
cout<<"i= "<<i;
}

I want to print The label i as well as its value by using Outtextxy. Is it possible.
I knew that Outtextxy is used to display strings.
but i dont want to use cout.

4
Contributors
6
Replies
8
Views
10 Years
Discussion Span
Last Post by vicky_dev
0

Use
char num[2];
outtextxy(x,y, itoa(integer, num, 10));

It works

Thanks i got cleared now

1

There is a better way to do it:

char buffer[30];

sprintf( buffer, "i = %d", num );
outtextxy( x, y, buffer );

This is a more general solution.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.