![]() |
| | #1 |
| Registered User Join Date: Feb 2010
Posts: 2
| Please help as soon as possible, it will be greatly appreciated. |
| watsee is offline | |
| | #2 |
| Registered User Join Date: Aug 2006
Posts: 94
| 1) Get Calender. 2) Find Today. 3) Count Backwards. 4) ??? 5) Profit! |
| rdrast is offline | |
| | #3 |
| Registered User Join Date: Feb 2010
Posts: 2
| OK I half expected a reply like that, come on man please. Its not even for me its for my girlfriend, maaaaajor brownie points if I get this working for her. So come on please someone out there must be able to help me properly. |
| watsee is offline | |
| | #4 |
| C++ Witch Join Date: Oct 2003 Location: Singapore
Posts: 12,459
| That makes it even worse, methinks ![]() Anyway, one idea is to compute the number of days that have gone by in the previous months of the year, and then add the number of days that have gone by in the current month.
__________________ C + C++ Compiler: MinGW port of GCC Build + Version Control System: SCons + Bazaar Look up a C/C++ Reference and learn How To Ask Questions The Smart Way |
| laserlight is offline | |
| | #5 | |
| Mysterious C++ User Join Date: Oct 2007
Posts: 16,078
| Well then, do you have any working code or logic for this? If not, then get started with the logic. Otherwise, post your current attempt and ask specific questions about what you don't understand. Furthermore, I would refrain from using "urgent" and "help" in the title. Members will reply at their own pace, when and if they can, regardless if you put in urgent or not. And help isn't very specific. Such titles ever deter some members.
__________________ Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2010 Ultimate, C++0x "Thanks Elysia. You're a programming master! How the hell do you know every thing?" "Thanks for all your help. It's obvious yall really know what you're talking about when it comes to OOP/C++ stuff." Quoted... at least once. Quote:
| |
| Elysia is offline | |
| | #6 |
| dat is, vast staat Join Date: Jul 2008 Location: SE Queens
Posts: 6,612
| Forty!
__________________ C programming resources: GNU C Function and Macro Index -- glibc reference manual The C Book -- nice online learner guide Current ISO draft standard CCAN -- new CPAN like open source library repository GDB tutorial #1 -- gnu debugger tutorials -- GDB tutorial #2 cpwiki -- our wiki on sourceforge |
| MK27 is offline | |
| | #7 | |
| Mysterious C++ User Join Date: Oct 2007
Posts: 16,078
| ...Uh, right.
__________________ Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2010 Ultimate, C++0x "Thanks Elysia. You're a programming master! How the hell do you know every thing?" "Thanks for all your help. It's obvious yall really know what you're talking about when it comes to OOP/C++ stuff." Quoted... at least once. Quote:
| |
| Elysia is offline | |
| | #8 |
| Registered User Join Date: Dec 2009 Location: Henderson, NV
Posts: 887
| Maybe the long way around the block but could conceivably result in shorter code is to get a Gregorian to Julian date converter fn from snippets.org, then call it twice, once with current date and once with 01012010 and subtract... |
| jeffcobb is offline | |
| | #10 |
| dat is, vast staat Join Date: Jul 2008 Location: SE Queens
Posts: 6,612
| I'd figure out the "seconds since the epoch" for 1/1/10 and then use difftime(). There are 3600 seconds in a day. For further help I think the OP needs to include a pic of the girlfriend. Only on Thursday.
__________________ C programming resources: GNU C Function and Macro Index -- glibc reference manual The C Book -- nice online learner guide Current ISO draft standard CCAN -- new CPAN like open source library repository GDB tutorial #1 -- gnu debugger tutorials -- GDB tutorial #2 cpwiki -- our wiki on sourceforge |
| MK27 is offline | |
| | #11 | |
| C++ Witch Join Date: Oct 2003 Location: Singapore
Posts: 12,459
| Quote:
__________________ C + C++ Compiler: MinGW port of GCC Build + Version Control System: SCons + Bazaar Look up a C/C++ Reference and learn How To Ask Questions The Smart Way | |
| laserlight is offline | |
| | #13 | |
| Registered User Join Date: Dec 2009 Location: Henderson, NV
Posts: 887
| Quote:
So if he/she turned it in on Thursday: Code: #include <stdio.h>
#include <string.h>
int main(int argc, char*argv[])
{
int nRC = 0;
char today[20];
memset(today, 0, 20);
// get the command line of day
if(argc > 1)
{
strncpy(today, argv[1], 20);
}
if( strcmp(today, 'thursday')==0)
{
printf("42!\n");
}
else
{
printf("Error in computation or input. Try again.\n");
// tell calling system that we are MASSIVE FAIL
nRC = -1;
}
return nRC;
}
./myapp thursday the correct answer will indeed pop out... | |
| jeffcobb is offline | |
| | #14 |
| C++ Witch Join Date: Oct 2003 Location: Singapore
Posts: 12,459
| At a glance, 'thursday' should be "thursday".
__________________ C + C++ Compiler: MinGW port of GCC Build + Version Control System: SCons + Bazaar Look up a C/C++ Reference and learn How To Ask Questions The Smart Way |
| laserlight is offline | |
| | #15 |
| Registered User Join Date: Dec 2009 Location: Henderson, NV
Posts: 887
| Sorry was just doing some Python....my mistake! ![]() You know, all joking aside, that can be one of the tricky things about constantly living with multiple languages with similar but not exact syntactical styles....and the single/double quote problem is only one. Like going from Object PASCAL to C++ I get wanting to do things like: Code: with <someobject> do:
foo()
// instead of
<someobject>.foo();
Last edited by jeffcobb; 02-09-2010 at 12:47 PM. |
| jeffcobb is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Urgent Help Needed In Writing Algorithm!! | Vikramnb | C++ Programming | 1 | 01-09-2009 12:46 PM |
| BitWise Newbie - Needs Urgent Help | frodonet | C Programming | 15 | 09-26-2007 12:58 PM |
| display character size...(quite urgent..) | karthi | C Programming | 10 | 07-11-2007 09:42 PM |
| beginner plzz help urgent | sara101 | C Programming | 11 | 01-14-2007 10:38 PM |
| printing the output its urgent | yviswanadham | C Programming | 6 | 12-26-2004 10:27 AM |