Re: passing variable number of arguments to a function
- From: Nick Keighley <nick_keighley_nospam@xxxxxxxxxxx>
- Date: Tue, 4 Aug 2009 02:41:21 -0700 (PDT)
On 4 Aug, 08:15, arnuld <arnuld.miz...@xxxxxxxxx> wrote:
On Aug 3, 4:49 pm, Nick Keighley <nick_keighley_nos...@xxxxxxxxxxx> wrote:
this is one of the reasons I don't use ctime() (The "American" style
format isn't to my liking either). Take a look a strftime() or even roll
your own with sprintf() and localtime().
I wrote a wrapper function to print the ctime() without newline. Tell
me what you think:
void print_time(void)
{
char arrt[100] = {0};
char* p = arrt;
time_t t = time(NULL);
strcpy(arrt, ctime(&t));
while(*p != '\n') printf("%c", *p++);
}
same as i thought before. I don't like the format of the string
returned by ctime() so I'd write a function that did what i wanted
in the first place! But your code looks ok.
.
- References:
- passing variable number of arguments to a function
- From: arnuld
- Re: passing variable number of arguments to a function
- From: arnuld
- Re: passing variable number of arguments to a function
- From: Nick Keighley
- Re: passing variable number of arguments to a function
- From: arnuld
- passing variable number of arguments to a function
- Prev by Date: Re: passing variable number of arguments to a function
- Next by Date: Re: printing a string
- Previous by thread: Re: passing variable number of arguments to a function
- Next by thread: Re: passing variable number of arguments to a function
- Index(es):
Relevant Pages
|