Thread: delay time and backspace

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    11

    delay time and backspace

    Hello everybody,

    Is there a way to write a delay function that can delay what i want to display?

    And Can somebody teach me how to enable this password program that if i key in the wrong input i can backspace!!
    //----------------------------------------------------------------------------------
    #include <stdio.h>
    #include <conio.h>
    #include <ctype.h>
    #define pwd_size 10
    int main()
    {
    int ch;
    char pword[pwd_size];
    int i = 0;

    printf("Enter your password:");

    while ((ch = getch()) != EOF
    && ch != '\n'
    && ch != '\r'
    && i < sizeof(pword) - 1)
    {
    if (isalnum(ch))
    {
    putchar('*');
    pword[i++] = ch;

    }

    }

    pword[i] = '\0';

    printf ("\nYou entered >%s<", pword);

    return 0;
    }

    Thank For Your help
    Last edited by leinad079; 04-11-2003 at 05:53 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. telnet server, how to program a backspace
    By Mastermosley in forum C# Programming
    Replies: 5
    Last Post: 03-22-2009, 02:14 AM
  2. Printing a backspace
    By Leima in forum C Programming
    Replies: 4
    Last Post: 03-21-2009, 05:56 PM