• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Variable argument list not working
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Variable argument list not working


  • Subject: Variable argument list not working
  • From: Pierre-Olivier Latour <email@hidden>
  • Date: Tue, 13 Aug 2002 19:56:58 +0200

Hi,

In a .cp file I have this function I'd like to call (it's just a test now:
it'll get more complicated later ;) ):

void PixelShox_LogMessage(PSEStringPtr message, ...)
{
va_list args;

va_start(args, message);
printf(message, args);
va_end(args);
printf("\n");
}

However, calling:
PixelShox_LogMessage("Test: %s %s", "(1)", "(2)");

prints:
"Test: (2)" and the new line char

I've done many tests, but I can't figure out what's going wrong, and why the
2 argument disappears... Is it because the function is in a .cp file?


_____________________________________________________________

Pierre-Olivier Latour email@hidden
Lausanne, Switzerland http://www.pol-online.net
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Variable argument list not working
      • From: Jim Correia <email@hidden>
  • Prev by Date: Re: Documents which aren't NSDocuments
  • Next by Date: RE: Variable argument list not working
  • Previous by thread: Re: Printing for Document-based app
  • Next by thread: Re: Variable argument list not working
  • Index(es):
    • Date
    • Thread