Thread: How do you write a functions declaration?

  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    58

    How do you write a functions declaration?

    If I have this function..
    Code:
    void push(void *value, void *stack)
    {
         //code
    }
    how do you write its function declaration?

    like this?
    Code:
    void push(void, void);

  2. #2
    Registered User ch4's Avatar
    Join Date
    Jan 2007
    Posts
    154
    Code:
    void push(void *,void *);

  3. #3
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    You can do as ch4 mentions, but it is perfectly acceptable (and a good idea) to use
    Code:
    void push(void *value, void *stack);
    as your function prototype. (This way, just by reading the header, you can tell which argument does what.)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Errors including <windows.h>
    By jw232 in forum Windows Programming
    Replies: 4
    Last Post: 07-29-2008, 01:29 PM
  2. Quantum Random Bit Generator
    By shawnt in forum C++ Programming
    Replies: 62
    Last Post: 06-18-2008, 10:17 AM
  3. Expression Manipulator v0.2 (bug fixes, functions)
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 05-26-2003, 04:52 PM
  4. Serial Communications in C
    By ExDigit in forum Windows Programming
    Replies: 7
    Last Post: 01-09-2002, 10:52 AM
  5. functions to write a file
    By subbuy2k in forum C++ Programming
    Replies: 1
    Last Post: 12-27-2001, 10:59 AM