Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #13645

Re: Variable argument function as a parameter of a variable argument function

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: Variable argument function as a parameter of a variable argument function
Date 2011-11-20 08:19 -0800
Organization None to speak of
Message-ID <lnobw6wyud.fsf@nuthaus.mib.org> (permalink)
References <00f0752d-f768-437a-87c5-0b3767c7411f@l24g2000yqm.googlegroups.com>

Show all headers | View raw


AikidoGuy <aikidoguy@gmail.com> writes:
> I've done a little searching, but I can't quite find an answer to my
> question. Everything I've found is more related to how to construct a
> variable argument function, and that's not my question.
>
> Suppose I have a variable argument function. Is it possible to use it
> to initialize a parameter of another variable argument function?
>
> For example, printf("%s", varArgFcnReturningAString(a,b,c));
>
> I ask because I'm not sure if this is supported by the standard and/or
> could be compiler specific.

varArgFcnReturningAString(a,b,c) is (presumably) and expression of
type char*.  printf("%s", blah) requires an expression of type char*.
What problem do you imagine there might be?  Why should a call to
a variadic function in this context be treated any differently than
a call to a non-variadic function?

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Variable argument function as a parameter of a variable argument function AikidoGuy <aikidoguy@gmail.com> - 2011-11-19 23:02 -0800
  Re: Variable argument function as a parameter of a variable argument function Ark <akhasin@macroexpressions.com> - 2011-11-20 03:14 -0500
  Re: Variable argument function as a parameter of a variable argument function Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-20 08:07 -0500
    Re: Variable argument function as a parameter of a variable argument function Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-20 08:11 -0500
  Re: Variable argument function as a parameter of a variable argument function Keith Thompson <kst-u@mib.org> - 2011-11-20 08:19 -0800
  Re: Variable argument function as a parameter of a variable argument function pete <pfiland@mindspring.com> - 2011-11-20 13:33 -0500
    Re: Variable argument function as a parameter of a variable argument function AikidoGuy <aikidoguy@gmail.com> - 2011-11-20 15:29 -0800
      Re: Variable argument function as a parameter of a variable argument function Keith Thompson <kst-u@mib.org> - 2011-11-20 15:58 -0800
        Re: Variable argument function as a parameter of a variable argument function AikidoGuy <aikidoguy@gmail.com> - 2011-11-20 16:05 -0800
          Re: Variable argument function as a parameter of a variable argument function James Kuyper <jameskuyper@verizon.net> - 2011-11-20 20:45 -0500
            Re: Variable argument function as a parameter of a variable argument function AikidoGuy <aikidoguy@gmail.com> - 2011-11-20 20:18 -0800
              Re: Variable argument function as a parameter of a variable argument function James Kuyper <jameskuyper@verizon.net> - 2011-11-21 07:22 -0500
                Re: Variable argument function as a parameter of a variable argument function Seebs <usenet-nospam@seebs.net> - 2011-11-21 22:43 +0000

csiph-web