By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,108 Members | 1,398 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,108 IT Pros & Developers. It's quick & easy.

time in c++

P: n/a
I was wondering if there was a way to get the time in an ANSI/ISO C++ program. I know that I can use the header <time.h>. I was under the impression though that I should stay away from headers that end in .h as they are normally the antiquated versions. Only thing is when I try to use <time> the compiler says the header is not found. Any input/corrections in thought would be much appreciated.
Jul 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Theron NightStar wrote:

I was wondering if there was a way to get the time in an ANSI/ISO C++ program. I know that I can use the header <time.h>. I was under the impression though that I should stay away from headers that end in .h as they are normally the antiquated versions. Only thing is when I try to use <time> the compiler says the header is not found. Any input/corrections in thought would be much appreciated.


did you try <ctime> ?

time.h is a leftover from the C grandparent of C++.
The C++ version of those headers usually have a 'c'
in front of them to remind you of that fact.
--
Karl Heinz Buchegger
kb******@gascad.at
Jul 23 '05 #2

P: n/a
Karl Heinz Buchegger wrote:
Theron NightStar wrote:

I was wondering if there was a way to get the time in an ANSI/ISO C++ program. I know that I can use the header <time.h>. I was under the impression though that I should stay away from headers that end in .h as they are normally the antiquated versions. Only thing is when I try to use <time> the compiler says the header is not found. Any input/corrections in thought would be much appreciated.


did you try <ctime> ?

time.h is a leftover from the C grandparent of C++.
The C++ version of those headers usually have a 'c'
in front of them to remind you of that fact.


lol sorry - that simply made too much sense - thanks
Jul 23 '05 #3

P: n/a
Theron NightStar wrote:
I was wondering if there was a way to get the time in an ANSI/ISO C++ program. I know that I can use the header <time.h>. I was under the impression though that I should stay away from headers that end in .h as they are normally the antiquated versions. Only thing is when I try to use <time> the compiler says the header is not found. Any input/corrections in thought would be much appreciated.


C standard header <x.h>
replaced by
C++ standard header <cx>

--
imalone
Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.