Thread: Declaring the format function

  1. #1
    Code Warrior
    Join Date
    Nov 2001
    Posts
    669

    Question Declaring the format function

    Hi!

    Anyone knows how to write a function that would be the same as printf? You know with all the format specifiers (%s, %d, ...) and that it can use \b, \n or \r.

    I saw that printf function is declared like this "int printf (const char *, ...)".

    I tried this kind of declaration for my own function and it is working but the format specifiers are not working. Anyone knows what that "..." means?

    Thanks.
    Current projects:
    1) User Interface Development Kit (C++)
    2) HTML SDK (C++)
    3) Classes (C++)
    4) INI Editor (Delphi)

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    bubba gives a fair explanation of variable args in this thread
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. const at the end of a sub routine?
    By Kleid-0 in forum C++ Programming
    Replies: 14
    Last Post: 10-23-2005, 06:44 PM
  2. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  3. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM
  4. c++ linking problem for x11
    By kron in forum Linux Programming
    Replies: 1
    Last Post: 11-19-2004, 10:18 AM
  5. Replies: 4
    Last Post: 11-23-2003, 07:15 AM