Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 132,234 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,110 people online right now. Registration is fast and FREE... Join Now!




c code for validation of only dd in DD/MM/YYYY date format

 
Reply to this topicStart new topic

c code for validation of only dd in DD/MM/YYYY date format, hi i have to have a code which can check for the validation purpose fo

ambi21hs
post 13 Mar, 2008 - 01:09 AM
Post #1


New D.I.C Head

*
Joined: 11 Mar, 2008
Posts: 4

hi i have to have a code which can check for the validation purpose for the date in the form of dd/mm/yyyy it shud check for the this format wn we r entering the date at run time.?
the code sould be in C can please help me out with this,.?
User is offlineProfile CardPM

Go to the top of the page

AmitTheInfinity
post 13 Mar, 2008 - 05:03 AM
Post #2


C Surfing ∞

Group Icon
Joined: 25 Jan, 2007
Posts: 1,015



Thanked 34 times

Dream Kudos: 125
My Contributions


QUOTE(ambi21hs @ 13 Mar, 2008 - 02:39 PM) *

hi i have to have a code which can check for the validation purpose for the date in the form of dd/mm/yyyy it shud check for the this format wn we r entering the date at run time.?
the code sould be in C can please help me out with this,.?



sorry, we can't do the homework for you.


But you can try something like this...

use strtok function to tokenize the string input of date on the basis of delimiter '/'.
now you have 3 strings. dd, mm and yyyy. convert them to integers and validate them for month date and year.
yeeee... you are done! Now, try this and come back if you have any problems.
User is offlineProfile CardPM

Go to the top of the page

PsychoCoder
post 13 Mar, 2008 - 05:25 AM
Post #3


using DIC.Core;

Group Icon
Joined: 26 Jul, 2007
Posts: 8,923



Thanked 117 times

Dream Kudos: 8475

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions


Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this: code.gif

Thanks smile.gif
User is online!Profile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/21/08 09:35PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month