#include <stdio.h>
#include <time.h>
char *ctime(time_t *clock)
int main()
{
printf("todayz time is..%c ",ctime);
}
#include <stdio.h>
#include <time.h>
char *ctime(time_t *clock)
int main()
{
printf("todayz time is..%c ",ctime);
}
There are 2 misstakes:
1. The function ctime cannot be used as a variable. In your main you need to declare a variable of type time_t, this should be passed to function ctime and the result can be printed.
2. The main needs to return a value, it is of type int.
can you please show me an example... cause i understand better by example..... thanxx
Try this
Code:#include <stdio.h> #include <time.h> int main(void) { time_t lt; lt = time(NULL); printf(ctime(& lt)); return 0; }
oops beaten to it. but left it because mines commentedCode:#include<stdio.h> #include<time.h> int main(void) { time_t TheTime; /* declare a variable of type time_t */ TheTime=time(NULL); /* get the time */ printf("The time is :- %s",ctime(&TheTime)); /* pass address of TheTime to ctime and print the result */ return 0; }
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
Ouch...left it because mines commented
That hurt dude
heh heh
I do comment my real code though *excuses excuses*