Link to home
Start Free TrialLog in
Avatar of sima1980
sima1980

asked on

display an item at a specific location

In C, how do I print something at a specific location?
eg;
printf("XXX");

I want XXX to be displayed on the current line(not named), at row 22.  
Avatar of gelbert
gelbert

Which OS? If it is Windows then use TextOut()
Standard C++ provides no features for controling how output is displayed.  In fact, standard C++ doesn't even assume that the output is going to am monitor,  It coudl be going to a file, a com device, etc.  So you have to resort to OS-specific and/or hardware-specific techniques to do this.

That is why we need to know what OS this is for--like gelbert asked.

If this is for a windows console program, you want to use WriteConsole() to do this.  You also might want to see if your compiler has the non-stadnard gotoxy() function in its library.  it is not part of standard C++, but many compilers do include it.
ASKER CERTIFIED SOLUTION
Avatar of AlexVirochovsky
AlexVirochovsky

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>> Most of compliers support
I wouldn't say most.  I would say "Borland".  I don't know of any non-borland C/C++ compiler that supports gotoxy().