Ask Experts Questions for FREE Help !
Ask
    Captain Outrageous's Avatar
    Captain Outrageous Posts: 8, Reputation: 2
    New Member
     
    #1

    Jan 28, 2007, 08:41 AM
    Input format in C
    In C programming, I am trying to force the user to enter a date in the format DD/MM/YYYY, and I want to make sure they input leading zeros if the day or month is less than 10. Is there any way to do this?

    Thanks
    asterisk_man's Avatar
    asterisk_man Posts: 476, Reputation: 32
    Full Member
     
    #2

    Jan 29, 2007, 09:28 AM
    1 prompt them with the correct format
    2 read their input
    3 validate their input against the correct format
    4 if their input is invalid give an error message and return to 1
    asterisk_man's Avatar
    asterisk_man Posts: 476, Reputation: 32
    Full Member
     
    #3

    Jan 31, 2007, 08:22 AM
    If you dislike my answer please explain which portion you need more information on. You asked "Is there any way to do this?" and I wrote you pseudocode that would accomplish your task.
    I assumed, based on the simplicity of your question, that it was probably a homework assignment of some form.
    You gave me negative reputation but you wanted more info, my answer was not wrong.
    We can continue to work on this question if you're still interested. You can post what code you have if you want or tell me which of my 4 steps you're having trouble with.
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #4

    Jan 31, 2007, 08:26 AM
    May I point the suggested guidelines for using the comments feature found here:

    https://www.askmehelpdesk.com/feedba...ure-24951.html

    You asked; "Is there any way to do this?" A valid answer would have been simply Yes. Not only did you get that answer, but you got the steps needed. If you wanted the actual code to do it, you should have asked for that. I think you owe Asterisk_man an apology.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

What the possibility? I really need some input! [ 4 Answers ]

I have been taking Yasmin (the oral contraceptive) for about 2 years now and haven't missed a pill in at least a year but this past weekend (sat) I was supposed to start a new pack and I totally forgot about it until Monday so I didn't get started on my BC until Monday night and then my boyfriend...

Citizens input [ 1 Answers ]

Which tends to be most responsive to citizens input? Local Government State government Federal government An international agency

A little break-up input please... [ 8 Answers ]

Hello everyone. Sorry for the long post. My girlfriend and I celebrated our one-year anniversary last month. We lived together (she pushed hard for that), and enjoyed many of the same interests. Around four months ago, she had to fire her business partner because he was stealing from her...

Input: When Debates Erupt [ 29 Answers ]

Ok, let's hear y'all's input. Asker asks for opinions and users give them. ... then members get into a debate over who's right and who's wrong (remember, the asker is asking for opinions). Recognizing the goal of the site to be a repository of answers, how far should these debates be...

Ok I need some outside input [ 10 Answers ]

Hello, I really think I need some help. I am with my boyfriend whom we have been together for two years now. I am 7 months pregnant and he just asked me to marry him on christmas. Sounds sweet huh. Well I am still with him because he was supposed to quit smoking pot, and he wasn't going to play...


View more questions Search