954,506 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Doubt in Outtextxy in C++ graphics

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

mjmythili
Newbie Poster
15 posts since Nov 2006
Reputation Points: 10
Solved Threads: 0
 

same answer as your other thread.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

Sorry i am not able to solve yet.

mjmythili
Newbie Poster
15 posts since Nov 2006
Reputation Points: 10
Solved Threads: 0
 

that compiler are you using? That is borland specific and will not work with non-borland compilers.

What are you trying to accomplish? There are probably other ways to do what you want to do. You can use these win32 api console functions to move the cursor to specific location. Just include windows.h in your program.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

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

It works

himanjim
Junior Poster in Training
67 posts since Jul 2006
Reputation Points: 14
Solved Threads: 1
 
Use char num[2]; outtextxy(x,y, itoa(integer, num, 10)); It works



Thanks i got cleared now

mjmythili
Newbie Poster
15 posts since Nov 2006
Reputation Points: 10
Solved Threads: 0
 

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.

vicky_dev
Junior Poster in Training
86 posts since May 2005
Reputation Points: 28
Solved Threads: 2
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You