Thread: Cursor placement on the screen

  1. #1
    Registered User
    Join Date
    May 2021
    Posts
    2

    Cursor placement on the screen

    Hello,

    I have successfully completed my hello world program and am using Microsoft Visual Studio on Windows 10 as my development environment for C++. I would like to know how to position the cursor on the screen.

    I have purchased "Learn C++ quickly" and "The Annotated C++ Reference Manual" but neither seem to have this information.

    Thank you very much!

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    https://faq.cprogramming.com/cgi-bin...&id=1043284392

    If you want to do more than just print text (using cout), then you'll need
    Console Functions - Windows Console | Microsoft Docs
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    May 2021
    Posts
    2
    Thanks for replying... my end goal is to write a console application that updates a screen with output going to specific places, for example, the current time would be written to the same place on the console. I am wanting to locate the cursor on the screen to specific areas. Was looking for the C++ equivalent to BASIC's "locate" command.

  4. #4
    Registered User
    Join Date
    Apr 2021
    Posts
    138
    There was once a Unix library called "curses". It is long since dead, but in the spirit of open source there are a bunch of clones of that library in various languages for various target architectures.

    I believe the PDCurses library (PDCurses) works on Windows.

    The great benefit of using something like this is that it's fairly standard and transferrable. You may find yourself on a different OS, using a different programming language, and still be able to write text positioning code because the idea of curses has carried over. ;-)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to find the cursor on the screen ?
    By simonleo27 in forum C Programming
    Replies: 6
    Last Post: 01-16-2007, 12:40 AM
  2. Screen Snapshot with Cursor
    By leojose in forum Windows Programming
    Replies: 2
    Last Post: 05-04-2005, 05:35 AM
  3. Cursor React to Screen Display
    By Lugtz in forum Windows Programming
    Replies: 5
    Last Post: 10-22-2004, 09:51 PM
  4. how do I move cursor to a certain spot on the screen (x,y) ?
    By freeman_peterso in forum C Programming
    Replies: 5
    Last Post: 07-11-2003, 12:30 PM

Tags for this Thread