Thread: Gotoxy Decimals

  1. #1
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    Gotoxy Decimals

    I tried using decimals in gotoxy. It doesn't work. Can anyone hellp me here? My specifics are in my info, thanks.

  2. #2
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    for instance...

    sorry, i would have been more specific in my first post but... i don't know... i guess i just forgot... for example... i tried to make it so that their could be more specific spots on the screen.

    Code:
    int main()
    {
         float pstx=.5;
         float psty=.5;
         pstx=pstx+.5;
         gotoxy(pstx,psty);
         cout << "hello";
    return 0;
    }

  3. #3
    Registered User Dr. Bebop's Avatar
    Join Date
    Sep 2002
    Posts
    96
    I'm pretty sure that gotoxy takes some kind of integer as parameters, you can't use floating point values because they'll just be truncated to 0. If you want more control of the screen you have to use higher graphics than the console's text terminal.
    Processing error: Stupidity detected.
    ------------------------------
    Dr. Bebop
    Windows XP Professional Ed.
    Microsoft Visual Studio 6

  4. #4
    Banal internet user
    Join Date
    Aug 2002
    Posts
    1,380
    gotoxy takes int arguments, so passing a float will implicity convert it to an int

    gotoxy takes int arguments because the xy coordinates to which 'goto' refers are the xy coordinates of the console; a pure-text enviroment... so a non-int position for text doesn't make much sense

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, 07:22 PM
  2. Need help to show decimals
    By engstudent363 in forum C Programming
    Replies: 4
    Last Post: 02-19-2008, 04:13 PM
  3. Want to see if I am using gotoxy the right way ...
    By o0obruceleeo0o in forum C++ Programming
    Replies: 5
    Last Post: 04-22-2003, 04:17 PM
  4. Is gotoxy ansi?
    By MeneLaus in forum C Programming
    Replies: 2
    Last Post: 05-18-2002, 02:48 PM
  5. is gotoxy a part of ANSI C 89 standard
    By kendals in forum C Programming
    Replies: 1
    Last Post: 03-20-2002, 07:43 PM