Simple Basic Problem in C

Discussion in 'C' started by naiya, Jun 24, 2007.

  1. naiya

    naiya New Member

    Joined:
    Jun 11, 2007
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    If I write the following code in program how can I see the output
    for(i=1;i<=15000;i++)
    printf("%d\t",i);
    Then I can see the numbers from 14761 to 15000.How can I see all the numbers from 1 to 15000.
    Please reply as soon as possible.
    Thanks in advance.
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,346
    Likes Received:
    382
    Trophy Points:
    83
    [COMMENT]This is by no means an article and so use the New thread button rather than submit article buttons[/COMMENT]

    Because everything just scrolls up and so you should have some way of having a user input mechanism like scanf, getche or getch functions before the screen-ful of characters goes above the top of the screen.
     
  3. munkyeetr

    munkyeetr New Member

    Joined:
    May 4, 2007
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Victoria BC, Canada
    Do you need to use the scroll bar in your output screen and scroll up to see the first 14760 iterations? Because I think that code should work.
     
  4. naiya

    naiya New Member

    Joined:
    Jun 11, 2007
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    Yes I want to use the scroll bar in my output screen and scroll up to see the first
    14760 iterations. How can I do this without using some scanf or getche functions?
     
  5. munkyeetr

    munkyeetr New Member

    Joined:
    May 4, 2007
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Victoria BC, Canada
    No, no, sorry. I just thought it was a simple mistake of not scrolling the Command window up and seeing the first chunk of the programs output.

    Disregard what I said, I've been eating paint chips again!
     
  6. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    http://www.daweidesigns.com
    Generally speaking, the buffers associated with a command line interface have a limited number of lines stored, even thought it's typically greater than the number of lines visible. If this is the case, then a scroll bar bill covesr the amount buffered. If the buffer holds less than the amount that has been displayed, then that material is lost.

    The whole thing is a somewhat silly question. Computers are not magic. Presume that you have several million tokens and a container to transfer them to. What happens if the container is non-existent, or holds 2000 items, or 2,000,000. It's unlikely that you will find one which is infinite and holds every thing ever displayed to a command window since its creation.

    Think of a way to solve the container/token problem and apply it.
     
  7. naiya

    naiya New Member

    Joined:
    Jun 11, 2007
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    Thanks to all for your response.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice