Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: space

  1. #1
    New Coder
    Join Date
    Jul 2002
    Location
    Malaysia
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    space

    Dear sir,

    I trying to write a program that accept alphanumeric from users. It will display an "Error!" message if users include space and negative number.

    num_string[100];
    void main(void)
    a=0;

    printf("Enter a word ")
    gets(num_string);

    {
    if (isalphanum(num_string[a] && !isspace(num_string[idx])
    valid = 1;
    else
    valid = 0;
    }
    if ((valid ==0) && num_string < 0)
    prinf("Error!");


    Thanks

    Xing

  • #2
    Regular Coder
    Join Date
    Feb 2003
    Location
    East Side/West Side
    Posts
    118
    Thanks
    0
    Thanked 0 Times in 0 Posts
    prinf("Error!");

    You're going to have some problems there - printf :-)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •