[ create a new paste ] login | about

Link: http://codepad.org/Q7VI8KFc    [ raw code | output | fork ]

C, pasted on Apr 15:
#include 
#include 
#include 

void main()
{
   struct timeval tvTime;
   struct tm tmOutput;

   gettimeofday(&tvTime, 0);
   localtime_r(&(tvTime.tv_sec), &tmOutput);

   tmOutput.tm_mon += 1;
   printf("password for today is: %x%02d-%02x%02d\n\n",
       tmOutput.tm_mon, tmOutput.tm_mon, tmOutput.tm_mday,
       gcd(tmOutput.tm_mon, tmOutput.tm_mday));
}

int gcd(int a, int b)
{
   return (b?gcd(b,a%b):a);
}


Output:
1
2
3
4
5
6
7
Line 9: error: #include expects "FILENAME" or <FILENAME>
Line 9: error: #include expects "FILENAME" or <FILENAME>
Line 9: error: #include expects "FILENAME" or <FILENAME>
In function 'main':
Line 7: error: storage size of 'tvTime' isn't known
Line 8: error: storage size of 'tmOutput' isn't known
Line 6: warning: return type of 'main' is not 'int'


Create a new paste based on this one


Comments: