Subdomain Posts
None | 33 days ago
C++ | 219 days ago
C | 717 days ago
C | 717 days ago
ASM (NASM) | 719 days ago
C | 747 days ago
None | 780 days ago
None | 782 days ago
None | 784 days ago
None | 794 days ago
Recent Posts
None | 9 sec ago
None | 16 sec ago
None | 35 sec ago
Java | 40 sec ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
Pic 16 | 2 min ago
None | 2 min ago
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By Hav0c on the 24th of Mar 2008 08:51:50 AM Download | Raw | Embed | Report
  1. #include <stdio.h>
  2.  
  3. struct data{
  4.         int day;
  5.         int month;
  6.         int year;
  7. };
  8. typedef struct data date;
  9.  
  10. date subs(date time,int whut,int omg)
  11. {
  12.         if(!whut){ // if whut == 0; change day, 1 = month, 2 = year etc
  13.                 if(time.day<omg) time.month--;
  14.                 if(time.month<1) time.year--;
  15.                 time.day -= omg;
  16.                 if(time.day < 1);
  17.                 // check what month it is so that if it's october for
  18.                 // example, it will add 31 instead of 30
  19.                 // i'm too lazy for that
  20.                 time.day = 30 - omg;
  21.         }
  22.         // rest of code, but im lazy for that
  23.         return(time);
  24. }
  25.  
  26. int main()
  27. {
  28.         date time;
  29.         time.day = 27;
  30.         time.month = 10;
  31.         time.year = 1991;
  32.         time = subs(time,0,10);
  33.         printf("Day: %d\n"
  34.                 "Month: %d\n"
  35.                 "Year: %d\n"
  36.                 ,time.day,time.month,time.year);
  37.         return(0);
  38. }
Submit a correction or amendment below. Make A New Post
To highlight particular lines, prefix each line with @@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: