syslog (varargs)

Handle unknown amount of variables within a function call ?

Page 1 of 1

3 Replies - 1945 Views - Last Post: 31 August 2010 - 01:54 AM Rate Topic: -----

#1 gda2004  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 111
  • Joined: 08-January 09

syslog (varargs)

Posted 20 August 2010 - 02:41 AM

Hi there,

I am interested to know how syslog handles an unknown amount of variables when it is called.

this is found in syslog.h ->
syslog(int, const char *, ...);

I know the ... means unknown amount of parameters I am just not sure how a function can handle this could anyone explain this to me

thanks,

GDA2004
Is This A Good Question/Topic? 0
  • +

Replies To: syslog (varargs)

#2 sarmanu  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 966
  • View blog
  • Posts: 2,362
  • Joined: 04-December 09

Re: syslog (varargs)

Posted 20 August 2010 - 02:54 AM

Using various functions from <cstdarg>. See this.
Was This Post Helpful? 0
  • +
  • -

#3 gda2004  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 111
  • Joined: 08-January 09

Re: syslog (varargs)

Posted 20 August 2010 - 02:59 AM

thanks for the link it is interesting
Was This Post Helpful? 0
  • +
  • -

#4 gda2004  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 111
  • Joined: 08-January 09

Re: syslog (varargs)

Posted 31 August 2010 - 01:54 AM

in the end I used a wrapper around vsyslog which can accept unknown amount of parameters ;)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1