C/C++ Positioning Cursor in Visual C++ Console Program - Help Needed

Click For Summary
The discussion centers on positioning the cursor in a Visual C++ console application, specifically addressing the absence of the traditional gotoxy() function. Users are advised to utilize the SetCursorPosition function instead, which is part of the Windows API for console applications. Additional resources are provided, including links to Microsoft documentation for SetCursorPosition and other Win32 console functions, offering further guidance on handling console output effectively.
jerkjames
Messages
1
Reaction score
0
I want to do this (HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);

if ( hConsole != INVALID_HANDLE_VALUE )
{
// do stuff...
...
}
) In visual c++, I generally use gotoxy() to position the http://www.seopromolinks.com/business_continuityplan.asp" ursor in a console program. Help needed
 
Last edited by a moderator:
Technology news on Phys.org
There is no "gotoxy" function either in the standard library or the Windows library. This was a Borland library function from the days of DOS that was ported to a few platforms. Use SetCursorPosition instead:

http://msdn2.microsoft.com/en-us/library/ms682073.aspx

More Win32 console functions are listed here:

http://msdn2.microsoft.com/en-us/library/ms686025.aspx
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
10
Views
5K
  • · Replies 14 ·
Replies
14
Views
34K
  • · Replies 86 ·
3
Replies
86
Views
12K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K