Cursor Position

This is a discussion on Cursor Position within the C Programming forums, part of the General Programming Boards category; There is a function to get the cursor position, isn't there??? Could someone tell me which one is that and ...

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    17

    Cursor Position

    There is a function to get the cursor position, isn't there???

    Could someone tell me which one is that and how it works, please???

    I just need to go to somewhere on the screen, to write a message and to be able to go back to where i was

    (i have forgotten) :P

    Thanks

    Frigga

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    That depends on your OS/compiler.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Depending on your compiler, you may be able to do:

    Code:
    #include <dos.h>
    
    int curr_x = wherex();
    int curr_y = wherey();
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  4. #4
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    Go to MSDN and look up GetConsoleScreenBufferInfo() if you are on a windows box.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  5. #5
    Registered User
    Join Date
    Nov 2002
    Posts
    17

    Talking sorry and thanks

    thanks guys for your reply and sorry because OF COURSE i should had said which compiler i'm using and which OS is it for

    but anyway i got my question answered... it's just for a simple DOS program and as i'm using Turbo C i can find both functions in "conio.h"

    Frigga

  6. #6
    Registered User unixOZ's Avatar
    Join Date
    Feb 2002
    Posts
    91
    When I was programming under DOS, I used gotoxy() in the conio.h, but it dependes on your compiler and OS.

Popular pages Recent additions subscribe to a feed

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