Correct Way To Use GoTo (x,y)?

This is a discussion on Correct Way To Use GoTo (x,y)? within the C++ Programming forums, part of the General Programming Boards category; Hi, I'm fairly new to Programming, currently taking my first course in it. For one of the assignments I have ...

  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    5

    Correct Way To Use GoTo (x,y)?

    Hi, I'm fairly new to Programming, currently taking my first course in it. For one of the assignments I have to do, I'm using nested loops to find the safe stopping distance of a car based on it's given speed and reaction time. And I need to print the information I find in a table, like such:

    10mph 20mph 30mph
    1sec x x x
    2sec x x x
    3sec x x x

    I've got all the code to find the info, but I don't understand the right way to use a goto(x,y) to plot the information corectly. Any help would be appreciated,

    Thanks!

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    There is no correct way to use a goto(x,y), because there is no such thing as goto(x,y). You need to print your table a row at a time.

  3. #3
    The larch
    Join Date
    May 2006
    Posts
    3,573
    You might rather need to format the output, determining how long the fields are and how they are aligned, in case of doubles specify the precision etc.

    E.g with the printf function.
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

  4. #4
    Registered User
    Join Date
    Jan 2011
    Posts
    5
    Thank you, this has been very helpful.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Access to drive only with USB stick
    By spadez in forum Windows Programming
    Replies: 26
    Last Post: 08-26-2009, 07:52 PM
  2. Linux for GNU/Linux is not correct?
    By password636 in forum Linux Programming
    Replies: 8
    Last Post: 03-31-2009, 09:30 PM
  3. temperature sensors
    By danko in forum C Programming
    Replies: 22
    Last Post: 07-10-2007, 08:26 PM
  4. Does goto have a glitch or...?
    By Blackroot in forum C++ Programming
    Replies: 9
    Last Post: 02-18-2006, 10:40 AM
  5. How do i use Goto?
    By Unregistered in forum C++ Programming
    Replies: 18
    Last Post: 01-06-2002, 10:38 AM

Tags for this Thread


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