How do I get to current x, y coordinates ?

This is a discussion on How do I get to current x, y coordinates ? within the A Brief History of Cprogramming.com forums, part of the Community Boards category; As title. Is it possible to get that ? Thanks !...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,485
    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,485
    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,485
    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, 11:52 AM
  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, 09: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, 01:02 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21