Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

data validation with a date dd//mm/yy 10 character

bazzanobazzano Posts: 15Member
I need to use fgets() function and check for character validation for a calender date in the format of dd//mmm/yy. Does anyone know how to do that im finding this difficult.


The user needs to be able to enter the date as dd//mm/yy all on the one line using fgets() and checking for 10 characters validility.


Thanks

Comments

  • stoberstober Posts: 9,765Member ✭✭✭
    : I need to use fgets() function and check for character validation for a calender date in the format of dd//mmm/yy. Does anyone know how to do that im finding this difficult.
    :
    :
    : The user needs to be able to enter the date as dd//mm/yy all on the one line using fgets() and checking for 10 characters validility.
    :
    :
    : Thanks
    :

    about the best you can do is split the string into its three parts -- month, day and year then validate each of these. For day check that it is not greater than the number of days in the given month. month check just simply between 1 and 12. year -- check that it is two digits, but you really should allow 4 digits to include the century.


Sign In or Register to comment.