Thread: How do I get to current x, y coordinates ?

  1. #1
    Registered User
    Join Date
    Jul 2002
    Posts
    85

    How do I get to current x, y coordinates ?

    As title. Is it possible to get that ?
    Thanks !

  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
    Coordinates of what?
    Your cursor
    Your mouse
    Your house

  3. #3
    Registered User
    Join Date
    Jul 2002
    Posts
    85
    I think is cursor...(I'm not sure.....sorry)
    Actually, my program is doing things like:
    1) print a char 'C'
    2)if the user enter R5 then the char 'C' will move 5 "steps" to right, L3 will move 3 "steps" to left.
    3)Display the coordinates of char 'C'

    I have no problem except 3).

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Rather than trying to figure out where it is now, remember where you last moved it to.

    int cur_x, cur_y;

    Then modify those values as appropriate, and draw your text in the new position

  5. #5
    Registered User
    Join Date
    Jul 2002
    Posts
    85
    Originally posted by Salem
    Rather than trying to figure out where it is now, remember where you last moved it to.

    int cur_x, cur_y;

    Then modify those values as appropriate, and draw your text in the new position
    Thanks ! It works !
    but is it impossible to get the current position if I don't use this method ?
    Last edited by Kelvin; 07-20-2002 at 01:47 PM.

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Well there should be a way, but its bound to be compiler specific

  7. #7
    Registered User
    Join Date
    Jul 2002
    Posts
    85
    Really thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Immediate programming help! Please!
    By xMEGANx in forum C++ Programming
    Replies: 6
    Last Post: 02-20-2008, 12:52 PM
  2. Problem with simple case statements
    By shoobsie in forum C Programming
    Replies: 2
    Last Post: 05-08-2006, 08:39 AM
  3. compiler build error
    By KristTlove in forum C++ Programming
    Replies: 2
    Last Post: 11-30-2003, 10:16 AM
  4. linked list recursive function spaghetti
    By ... in forum C++ Programming
    Replies: 4
    Last Post: 09-02-2003, 02:53 PM
  5. HelpMePlease
    By Prncess100 in forum C++ Programming
    Replies: 6
    Last Post: 12-11-2002, 02:02 PM