By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,825 Members | 2,437 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,825 IT Pros & Developers. It's quick & easy.

Problem regarding date in C

P: 1
Hello there,
I need to pass a date by command line arguments through a C program and need to find the past 7 days of that day what was being passed. How to tackle this situation?

Thanks in advance
Aug 10 '07 #1
Share this Question
Share on Google+
1 Reply


weaknessforcats
Expert Mod 5K+
P: 9,197
Just use the argc, argv arguments of main().

You need to specify how the date is passed:
1) hard-coded onthe command line
2) in a disc file (recommended)

Next, write a function that retreives this date and stores it in the program.

Next, write a function that returns true if the function argument date is within 7 days of the date supplied to the program (probably passed as a second function argument).
Aug 10 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.