Thread: How do i

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    69

    How do i please help

    #include <stdio.h>
    int select;
    struct Add;
    {
    char name[20];
    int deck[11];
    int count;
    }player,dealer;

    void Menu()
    {
    printf("Choose a Number 1-2\n (1)Start \n (2)Quit\n");
    scanf("%d",select);
    }


    void Play()
    {
    printf("What's your name?\n");
    scanf("%s",player.name);
    printf("What do you want the Dealers name to be:");
    scanf("%s",dealer.name);
    }


    void BlackJack()
    {
    Menu();
    if(select==1);
    {
    Play();
    }
    else if(select==2);
    {
    exit(0);
    }
    else;
    {
    printf("Please enter a number from 1-2");
    (delay(3000)
    system( "tput clear" );
    Menu();
    }
    }
    that's my basic header file
    what do i need to add to it so it's a header file and my program realises it?
    Last edited by knight543; 01-11-2002 at 06:57 PM.

  2. #2
    Registered User
    Join Date
    Jan 2002
    Posts
    69

    Any other ways

    are there any other ways i saw a delay() function but i don't know how it works.

  3. #3
    Flash Animator, OF DOOOOM bluehead's Avatar
    Join Date
    Nov 2001
    Posts
    269
    ........
    #include <dos.h> // The header file for delay();

    int main()
    {
    ............
    delay(5000);//The 5000 is the amount of milliseconds to wait
    ............
    }
    Code:
    #if _emo
      #define stereo_type_i_dislike
    #endif

  4. #4
    Flash Animator, OF DOOOOM bluehead's Avatar
    Join Date
    Nov 2001
    Posts
    269
    (2)Pause the program for half a second.
    Same concept.....

    just change the 5000


    (delay(5000);)



    to


    (delay(500);)



    That is the amount of milliseconds (1000 is a second if you didn't know) you want it to wait
    Code:
    #if _emo
      #define stereo_type_i_dislike
    #endif

  5. #5
    Registered User
    Join Date
    Jan 2002
    Posts
    69

    Bluehead

    hehe i know what milliseconds took me a while to realize milli keep thinking1000 not 1000th Well learning a bit of javascript has helped me learn c++.

  6. #6
    Flash Animator, OF DOOOOM bluehead's Avatar
    Join Date
    Nov 2001
    Posts
    269

    LOL

    LOL


    same here i learned what milliseconds were from javascript
    LOL what a coincidence
    Code:
    #if _emo
      #define stereo_type_i_dislike
    #endif

  7. #7
    Flash Animator, OF DOOOOM bluehead's Avatar
    Join Date
    Nov 2001
    Posts
    269
    (3)Clear the Screen
    oh, im sorry, i didn't see that


    This is a simpler way of doing it:




    .........
    #include <i forgot .h>

    int main()
    {
    .........
    clrscr();
    ......
    }


    Am i being a big help or what?
    Code:
    #if _emo
      #define stereo_type_i_dislike
    #endif

  8. #8
    Registered User
    Join Date
    Jan 2002
    Posts
    69

    header files

    Can anyone tell me how to add header files look at the first post

Popular pages Recent additions subscribe to a feed