Subdomain Posts
None | 42 days ago
C++ | 227 days ago
C | 725 days ago
C | 725 days ago
ASM (NASM) | 728 days ago
C | 756 days ago
None | 789 days ago
None | 791 days ago
None | 792 days ago
None | 803 days ago
Recent Posts
JavaScript | 34 sec ago
XML | 2 min ago
CSS | 2 min ago
None | 2 min ago
None | 3 min ago
None | 3 min ago
REBOL | 3 min ago
None | 4 min ago
PHP | 4 min ago
None | 5 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
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:59:44 AM Download | Raw | Embed | Report
  1. #include <stdio.h>
  2.  
  3. #define shit printf("Day: %d\nMonth: %d\nYear: %d\n",time.day,time.month,time.year)
  4.  
  5. struct data{
  6.         int day;
  7.         int month;
  8.         int year;
  9. };
  10. typedef struct data date;
  11.  
  12. date subs(date time,int whut,int omg)
  13. {
  14.         if(!whut){ // if whut == 0; change day, 1 = month, 2 = year etc
  15.                 if(time.day<omg) time.month--;
  16.                 if(time.month<1) time.year--;
  17.                 time.day -= omg;
  18.                 if(time.day < 1);
  19.                 // check what month it is so that if it's october for
  20.                 // example, it will add 31 instead of 30
  21.                 // i'm too lazy for that
  22.                 time.day = 30 - omg;
  23.         }
  24.         else if(whut == 1){
  25.                 time.month -= omg;
  26.                 if(time.month<1) time.year--;
  27.         }
  28.         else time.year -= omg;
  29.         return(time);
  30. }
  31.  
  32. int main()
  33. {
  34.         date time;
  35.         time.day = 27;
  36.         time.month = 10;
  37.         time.year = 1991;
  38.         shit;
  39.         time = subs(time,0,10);
  40.         shit;
  41.         time = subs(time,1,4);
  42.         shit;
  43.         time = subs(time,2,666);
  44.         shit;  
  45.         return(0);
  46. }
Submit a correction or amendment below. Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: