Thread: Cursor Prompt

  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    38

    Cursor Prompt

    I want to take input from the user in a console and want to have a prompt for that!
    How can I do that?

  2. #2
    root
    Join Date
    Sep 2003
    Posts
    232
    Code:
    char buffer[BUFSIZ]; /* BUFSIZ is defined in <stdio.h> */
    
    printf("Stuff: ");
    fflush(stdout);
    fgets(buffer, sizeof buffer, stdin);
    /* Now you have the user's input... */
    You can parse it however you like, but that's highly dependent on what kind of input you're trying to get.
    The information given in this message is known to work on FreeBSD 4.8 STABLE.
    *The above statement is false if I was too lazy to test it.*
    Please take note that I am not a technical writer, nor do I care to become one.
    If someone finds a mistake, gleaming error or typo, do me a favor...bite me.
    Don't assume that I'm ever entirely serious or entirely joking.

  3. #3
    Registered User
    Join Date
    Sep 2003
    Posts
    38

    BUT....

    But I want to show the cursor there like as in ms word!

  4. #4
    Been here, done that.
    Join Date
    May 2003
    Posts
    1,164

    Re: BUT....

    Originally posted by Lord CyKill
    But I want to show the cursor there like as in ms word!
    Works for me...
    Definition: Politics -- Latin, from
    poly meaning many and
    tics meaning blood sucking parasites
    -- Tom Smothers

Popular pages Recent additions subscribe to a feed