Is gotoxy ansi?

This is a discussion on Is gotoxy ansi? within the C Programming forums, part of the General Programming Boards category; I have written a dos prog for borland c, it uses gotoxy() for nearly all its layout. But when I ...

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

    Post Is gotoxy ansi?

    I have written a dos prog for borland c, it uses gotoxy() for nearly all its layout. But when I tried to compile in MSVC++ it just can't find gotoxy in the libs.

    So is gotoxy ansi or do i have to find an alternative to gotoxy() for my msvc++ port?

    This is a very big upset as I am writting it in ansi c for the sole purpose of compatibility.

    any help on getting gotoxy working in mscv or alternative functions would be apreciated.


    Thanks.

  2. #2
    Registered User C_Coder's Avatar
    Join Date
    Oct 2001
    Posts
    523
    No gotoxy isn't ansi standard and msvc dosen't have it. However all is not lost:
    Code:
    #include <windows.h>
    
    void gotoxy(int x, int y)
    {
       COORD coord;
       coord.X = x;
       coord.Y = y;
      SetConsoleCursorPosition(GetStdHandle(STD_OUTPUTHANDLE),coord);
    }
    [edit] Arrrghhh Why the feck wont the SetConsoleCursorPosition function display on one line
    Last edited by C_Coder; 05-18-2002 at 02:50 PM.
    All spelling mistakes, syntatical errors and stupid comments are intentional.

  3. #3
    Registered User
    Join Date
    May 2002
    Posts
    2
    Thanks,

    still solve the main problem though.

    unless I use some kind of #ifdef on which compiler is bing used.


    I will try anyway.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Tic Tac Toe movement
    By $l4xklynx in forum Game Programming
    Replies: 4
    Last Post: 11-06-2008, 06:22 PM
  2. ANSI C Reference
    By Stack Overflow in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 03-09-2005, 09:08 PM
  3. sigaction() and ANSI C
    By awoodland in forum Linux Programming
    Replies: 4
    Last Post: 04-25-2004, 01:48 AM
  4. gotoxy(), possible under ANSI?
    By Vber in forum C Programming
    Replies: 1
    Last Post: 11-18-2002, 07:50 AM
  5. is gotoxy a part of ANSI C 89 standard
    By kendals in forum C Programming
    Replies: 1
    Last Post: 03-20-2002, 06:43 PM

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