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...
By Hav0c on the 24th of Mar 2008 08:59:44 AM
Download |
Raw |
Embed |
Report
#include <stdio.h>
#define shit printf("Day: %d\nMonth: %d\nYear: %d\n",time.day,time.month,time.year)
struct data{
int day;
int month;
int year;
};
typedef struct data date;
date subs(date time,int whut,int omg)
{
if(!whut){ // if whut == 0; change day, 1 = month, 2 = year etc
if(time.day<omg) time.month--;
if(time.month<1) time.year--;
time.day -= omg;
if(time.day < 1);
// check what month it is so that if it's october for
// example, it will add 31 instead of 30
// i'm too lazy for that
time.day = 30 - omg;
}
else if(whut == 1){
time.month -= omg;
if(time.month<1) time.year--;
}
else time.year -= omg;
return(time);
}
int main()
{
date time;
time.day = 27;
time.month = 10;
time.year = 1991;
shit;
time = subs(time,0,10);
shit;
time = subs(time,1,4);
shit;
time = subs(time,2,666);
shit;
return(0);
}
Submit a correction or amendment below.
Make A New Post