| | |
Date Alert Reminder
![]() |
•
•
Join Date: Oct 2005
Posts: 10
Reputation:
Solved Threads: 0
Hi...Im trying to make a date reminder type program...But Im looking for something along the lines of If(date == 31102005){*code*....May I please have help with this?? This is what i did...But is totally wrong...I need something that checks the date...where the user does not enter data.
C Syntax (Toggle Plain Text)
#include <stdio.h> #include <windows.h> #include <time.h> int main(void) { int day, month, year; if (day == 31 & month == 10 & year == 2005) { system("Echo Happy Halloween!"); } return(0); }
see the ansi time() function, decribed in the C time.h header file.
Here is my code, in C :
Here is my code, in C :
C Syntax (Toggle Plain Text)
#include <stdlib.h> #include <stdio.h> #include <time.h> /**retrieves the current date. * the given parameters are filled with the current time values */ void retrieve_time(int* day, int* month, int *year) { time_t t=time(NULL); struct tm* timeinfo=localtime(&t); *day=timeinfo->tm_mday; *month=timeinfo->tm_mon+1;/*junuary->1 december->12*/ *year=timeinfo->tm_year+1900; } int main(void) { int day, month, year; retrieve_time(&day, &month, &year); if(day==31 && month==10 && year==2005) { printf("happy halloween 2005 !\n"); } return EXIT_SUCCESS; }
![]() |
Similar Threads
- Display client's PC Date & Time (ASP.NET)
- Virus ALert! (Viruses, Spyware and other Nasties)
- Error while trying the update query (ASP)
- Check existing users in the database (ASP)
- Error: Expected ')' (Site Layout and Usability)
Other Threads in the C Forum
- Previous Thread: The Powers Of Two
- Next Thread: Time Release Message Box
| Thread Tools | Search this Thread |
#include * ansi array arrays asterisks bash binarysearch centimeter changingto char character convert copyimagefile cprogramme creafecopyofanytypeoffileinc createprocess() database dynamic execv feet fgets file floatingpointvalidation fork function getlogicaldrivestrin givemetehcodez grade gtkwinlinux hacking histogram ide inches include incrementoperators infiniteloop initialization input interest intmain() iso kernel keyboard kilometer km license linked linkedlist linux list lists locate looping lowest matrix meter microsoft number oddnumber open opendocumentformat openwebfoundation owf pdf pointer pointers posix power probleminc process program programming radix recursion recv recvblocked research reversing segmentationfault sequential single socket socketprograming socketprogramming standard strchr string suggestions systemcall test threads turboc unix urboc user variable wab whythiscodecausesegmentationfault windowsapi





