Thread: What is gotoxy??

  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
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675

  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
    28,413
    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.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    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
    28,413
    Ah, I see. Comment out that line to see what difference it makes when you recompile and run the program.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    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, 04: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, 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