Ahg! Time!

H

HardHackz

Okay, well, I found out how to get the username:

getenv("username")

Now, I want to get the time. I've tried including time.h and doing:

time() or localtime()

And there is some error in time.h because something has to few
arguments in time.h...some help?

Thanks in advance,
..::HardHackz::.
 
A

Arun

Okay, well, I found out how to get the username:

getenv("username")

Now, I want to get the time. I've tried including time.h and doing:

time() or localtime()

you could try gettimeofday.

And there is some error in time.h because something has to few
arguments in time.h...some help?

??? what error ???
Thanks in advance,
.::HardHackz::.

-A
 
R

red floyd

Okay, well, I found out how to get the username:

getenv("username")

Now, I want to get the time. I've tried including time.h and doing:

time() or localtime()

And there is some error in time.h because something has to few
arguments in time.h...some help?

You have an error on line 42 of your code.

In other words, we're not psychic. We don't know what error you've got,
what your code looks like, etc...

Post a minimal, *COMPILABLE* example, along with the errors, and
expected behavior, and then we can help.

See http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.8
 
V

Victor Bazarov

Okay, well, I found out how to get the username:

getenv("username")

Now, I want to get the time. I've tried including time.h and doing:

time() or localtime()

And there is some error in time.h because something has to few
arguments in time.h...some help?

RTFM. 'time' requires one argument - the pointer to a time_t object.
You may pass 0 but you can't just omit it. 'localtime' requires one
argument as well, what do you pass, nothing? RTFM

V
 
J

John Harrison

Okay, well, I found out how to get the username:

getenv("username")

Now, I want to get the time. I've tried including time.h and doing:

time() or localtime()

And there is some error in time.h because something has to few
arguments in time.h...some help?

Thanks in advance,
.::HardHackz::.

The time interface is really wierd. Designed in the bad old days when
no-one knew the difference between a good interface and a bad one.

But it's not too complex, you can pick it up pretty quickly, just look
at one of the many references on the internet, or in a book. Do that,
and if you still have questions ask again.

john
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top