What is gotoxy??

This is a discussion on What is gotoxy?? within the C Programming forums, part of the General Programming Boards category; Hi, I'm having trouble understanding the use of gotoxy in this program given in my text book. It's for converting ...

  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    16

    What is gotoxy??

    Hi, I'm having trouble understanding the use of gotoxy in this program given in my text book. It's for converting a decimal to hexadecimal number using for and switch().

    They've used an infinite for loop, variables x and z for finding the quotient and remainder of decimal number x when divided by 16.

    Then, they initialised a variable y=30, and used a statement

    Code:
    gotoxy(y--, 5);
    Then within the for loop comes switch() for printing characters A to F if remainder>9.

    I understand everything except the gotoxy part. Oh, and #include<process.h> is also used, and I don't have a clue about it. Help!

  2. #2
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,655

  3. #3
    Registered User
    Join Date
    May 2008
    Posts
    16
    OK.. so, does it print the last quotient and the preceding remainders in the reverse order?

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,256
    Quote Originally Posted by Beachblue
    OK.. so, does it print the last quotient and the preceding remainders in the reverse order?
    No.

    Continue guessing. When you get exactly the right answer we'll say yes. Or maybe you could just stop ignoring rags_to_riches' link.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Registered User
    Join Date
    May 2008
    Posts
    16
    Quote Originally Posted by laserlight View Post
    No.

    Continue guessing. When you get exactly the right answer we'll say yes. Or maybe you could just stop ignoring rags_to_riches' link.
    I'm sorry. I did use the link, and I understood what gotoxy does, viz., set the cursor position on screen. But the definition didn't help me understand its use in this program, which is why I came to this board.

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,256
    Ah, I see. Comment out that line to see what difference it makes when you recompile and run the program.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  7. #7
    Registered User
    Join Date
    May 2008
    Posts
    16
    Yes, it's displaying the output in reverse order. For 31, the hexadecimal value 1F was displayed as F1.

    Thank you very much.

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. gotoxy(); help!!
    By clique in forum C Programming
    Replies: 2
    Last Post: 10-07-2008, 05:08 AM
  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, 05:17 PM
  4. Is gotoxy ansi?
    By MeneLaus in forum C Programming
    Replies: 2
    Last Post: 05-18-2002, 03: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

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