Thread: conio.h, toupper(), and a craps game

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    4

    Unhappy conio.h, toupper(), and a craps game

    Does anybody know what conio.h and toupper() do. If you de please tell me. Also if anybody has a good craps program they would like to share please tell me.

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    15
    Well, the toupper converts the text entered to uppercase letters. Conio.h is a header file that contains the getch command. It contains more then that but I'm not sure about the other commands.

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    207
    This information comes from my compiler, you should try with the "help" from yours.


    conio.h contains the next functions:

    cgets clreol clrscr cprintf
    cputs cscanf delline getch
    getche getpass gettext gettextinfo
    gotoxy highvideo insline inp
    inport inportb inpw kbhit
    lowvideo movetext normvideo outp
    outport outportb outpw putch
    puttext _setcursortype textattr textbackground
    textcolor textmode ungetch wherex
    wherey window
    /* _toupper example */

    #include <string.h> #include <stdio.h> #include <ctype.h>

    int main(void) {
    int length, i;
    char *string = "this is a string.";

    length = strlen(string);
    for (i = 0; i < length; i++) {
    if ((string[i] >= 'a') && (string[i] <= 'z')){
    string[i] = _toupper(string[i]);
    }
    }
    printf("%s\n",string);
    return 0;
    }

Popular pages Recent additions subscribe to a feed