Thread: Command line programming problem.

  1. #1
    Registered User
    Join Date
    Sep 2012
    Location
    Birmingham, UK
    Posts
    3

    Post Command line programming problem.

    Hello,

    I'm currently doing some simple command line programming, and have a starting point here. What I would like is to have the bottom scrolly 80 characters wide without the console forcing a line feed. For instance, if I could get something like this:

    Code:
    for(c=0; c<50; c++)
    {
         for(i=0; i<80; i++)
         {
              printf(".");
         }
    }
    to fill the console entirely (assuming a console size of 80 columns by 50 rows).

    I've looked on MSDN and the information isn't very clear (although, as always, it reads okay).

    Ta folks,

    S.

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    You mean you want to be able to write a character to the bottom right of a screen (if you are working full screen) or a window (if you are working with a console window within a windowing system) and not have a newline occur when you do?

    If so, you have mistitled the thread. That is not "command line programming", simple or otherwise.

    One workaround, with some screen/window types that support an "insert mode" is to write the last line backward (eg write the character you want in the bottom right corner one left of that position, position the cursor left of that character, and insert the character you want at the left).

    If you are using Microsoft's console functions to do this, look up the SetConsoleMode() function - it provides an option to put a console window into insert mode. Also, it is a bad idea to mix printf() calls with Microsoft's console output functions, since they do not cooperate all that well.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  3. #3
    Registered User
    Join Date
    Sep 2012
    Location
    Birmingham, UK
    Posts
    3
    Thanks Grumpy, I found a solution, which is here.

    I should now be able to do what I want to.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. command line args problem
    By coderplus in forum C Programming
    Replies: 4
    Last Post: 05-08-2012, 11:38 AM
  2. (*pointers) & Command Line problem...?
    By allan01123 in forum C Programming
    Replies: 5
    Last Post: 03-17-2011, 05:48 PM
  3. command line parameters problem...
    By ac251404 in forum C++ Programming
    Replies: 2
    Last Post: 08-23-2006, 12:44 PM
  4. Command Line Argument problem
    By dredre in forum C Programming
    Replies: 2
    Last Post: 04-29-2004, 01:26 AM
  5. command line input problem
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 12-24-2001, 09:36 PM

Tags for this Thread