Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > _TIME_

Reply
Thread Tools

_TIME_

 
 
ramu
Guest
Posts: n/a
 
      08-06-2008
Hi,
Could you please let me know how to use _TIME_ macro with a
sample code?

Regards
 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      08-06-2008
ramu wrote:
> Hi,
> Could you please let me know how to use _TIME_ macro with a
> sample code?
>

#include <stdio.h>

int main(void)
{
puts(__TIME__);
}

--
Ian Collins.
 
Reply With Quote
 
 
 
 
Robert Gamble
Guest
Posts: n/a
 
      08-06-2008
On Aug 6, 6:49*pm, ramu <ramu....@gmail.com> wrote:
> Hi,
> * * * *Could you please let me know how to use _TIME_ macro with a
> sample code?
>
> Regards


It's __TIME__, with 4 underscores:

#include <stdio.h>

int main (void) {
puts(__TIME__);
return 0;
}

--
Robert Gamble
 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      08-07-2008
Ian Collins wrote:
> ramu wrote:
>
>> Could you please let me know how to use _TIME_ macro with a
>> sample code?

>
> #include <stdio.h>
> int main(void) {
> puts(__TIME__);
> }


Reading the (easily available) standard is much faster. I.e:

6.10.8 Predefined macro names

[#1] The following macro names shall be defined by the
implementation:

.... snip ...

__TIME__ The time of translation of the source file: a
character string literal of the form "hh:mm:ss" as
in the time generated by the asctime function. If
the time of translation is not available, an
implementation-defined valid time shall be
supplied.

Some useful references about C:
<http://www.ungerhu.com/jxh/clc.welcome.txt>
<http://c-faq.com/> (C-faq)
<http://benpfaff.org/writings/clc/off-topic.html>
<http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf> (C99)
<http://cbfalconer.home.att.net/download/n869_txt.bz2> (C99, txt)
<http://www.dinkumware.com/c99.aspx> (C-library}
<http://gcc.gnu.org/onlinedocs/> (GNU docs)
<http://clc-wiki.net/wiki/C_community:comp.lang.c:Introduction>

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.

 
Reply With Quote
 
santosh
Guest
Posts: n/a
 
      08-07-2008
CBFalconer wrote:

> Ian Collins wrote:
>> ramu wrote:
>>
>>> Could you please let me know how to use _TIME_ macro with a
>>> sample code?

>>
>> #include <stdio.h>
>> int main(void) {
>> puts(__TIME__);
>> }

>
> Reading the (easily available) standard is much faster. I.e:



The Standard isn't easily available at all from the perspective of a
beginner. Even the existence of a Standard, it's Committee's website,
and the presence of public drafts is unknown to the vast majority of
newbies. Besides, the Standard document (or the draft) is _not_ a good
place for a newbie to seek help. He would be much better off with
almost any decent C book or tutorial.

> 6.10.8 Predefined macro names
>
> [#1] The following macro names shall be defined by the
> implementation:
>
> ... snip ...
>
> __TIME__ The time of translation of the source file: a
> character string literal of the form "hh:mm:ss" as
> in the time generated by the asctime function. If
> the time of translation is not available, an
> implementation-defined valid time shall be
> supplied.


This would be most opaque to someone just starting out with C. Terms
like "implementation", "translation", "character string
literal", "asctime", "implementation-defined valid time" etc., are
likely to be confusing at best.

<snip>

 
Reply With Quote
 
Richard
Guest
Posts: n/a
 
      08-07-2008
santosh <> writes:

> CBFalconer wrote:
>
>> Ian Collins wrote:
>>> ramu wrote:
>>>
>>>> Could you please let me know how to use _TIME_ macro with a
>>>> sample code?
>>>
>>> #include <stdio.h>
>>> int main(void) {
>>> puts(__TIME__);
>>> }

>>
>> Reading the (easily available) standard is much faster. I.e:

>
>
> The Standard isn't easily available at all from the perspective of a
> beginner. Even the existence of a Standard, it's Committee's website,
> and the presence of public drafts is unknown to the vast majority of
> newbies. Besides, the Standard document (or the draft) is _not_ a good
> place for a newbie to seek help. He would be much better off with
> almost any decent C book or tutorial.
>
>> 6.10.8 Predefined macro names
>>
>> [#1] The following macro names shall be defined by the
>> implementation:
>>
>> ... snip ...
>>
>> __TIME__ The time of translation of the source file: a
>> character string literal of the form "hh:mm:ss" as
>> in the time generated by the asctime function. If
>> the time of translation is not available, an
>> implementation-defined valid time shall be
>> supplied.

>
> This would be most opaque to someone just starting out with C. Terms
> like "implementation", "translation", "character string
> literal", "asctime", "implementation-defined valid time" etc., are
> likely to be confusing at best.
>
> <snip>


very well said. There is hope for you yet.
 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      08-07-2008
santosh wrote:
> CBFalconer wrote:
>

.... snip ...
>
>> Reading the (easily available) standard is much faster. I.e:

>
> The Standard isn't easily available at all from the perspective
> of a beginner. Even the existence of a Standard, it's Committee's
> website, and the presence of public drafts is unknown to the vast
> majority of newbies. Besides, the Standard document (or the draft)
> is _not_ a good place for a newbie to seek help. He would be much
> better off with almost any decent C book or tutorial.


That's why I attached a list of places to get such things, which
you snipped. Most newbies accessing Usenet have access to the WWW
system.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.


 
Reply With Quote
 
santosh
Guest
Posts: n/a
 
      08-07-2008
CBFalconer wrote:

> santosh wrote:
>> CBFalconer wrote:
>>

> ... snip ...
>>
>>> Reading the (easily available) standard is much faster. I.e:

>>
>> The Standard isn't easily available at all from the perspective
>> of a beginner. Even the existence of a Standard, it's Committee's
>> website, and the presence of public drafts is unknown to the vast
>> majority of newbies. Besides, the Standard document (or the draft)
>> is _not_ a good place for a newbie to seek help. He would be much
>> better off with almost any decent C book or tutorial.

>
> That's why I attached a list of places to get such things, which
> you snipped. Most newbies accessing Usenet have access to the WWW
> system.


That still leaves unsolved the difficulty for a newbie of comprehending
the Standard's language. The C Standard is only accessible for someone
already fairly experienced with C (at least a year I would say), unless
the person were extraordinarily bright.

 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      08-07-2008
santosh wrote:
> CBFalconer wrote:
>> santosh wrote:
>>> CBFalconer wrote:
>>>

>> ... snip ...
>>>
>>>> Reading the (easily available) standard is much faster. I.e:
>>>
>>> The Standard isn't easily available at all from the perspective
>>> of a beginner. Even the existence of a Standard, it's Committee's
>>> website, and the presence of public drafts is unknown to the vast
>>> majority of newbies. Besides, the Standard document (or the draft)
>>> is _not_ a good place for a newbie to seek help. He would be much
>>> better off with almost any decent C book or tutorial.

>>
>> That's why I attached a list of places to get such things, which
>> you snipped. Most newbies accessing Usenet have access to the WWW
>> system.

>
> That still leaves unsolved the difficulty for a newbie of
> comprehending the Standard's language. The C Standard is only
> accessible for someone already fairly experienced with C (at least
> a year I would say), unless the person were extraordinarily bright.


Well, we definitely disagree here. Being fairly facile in
English is probably needed, though.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57