Thread: Pointers

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    You're wrong
    void means that there are NO arguments, while nothing in the parameter list means, in C only, any number of arguments. In C++, an empty argument list and a void argument list are the same.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  2. #2
    Never Exist Hermitsky's Avatar
    Join Date
    Jul 2004
    Posts
    149
    is this legal ?
    Code:
    void variable1;
    if it is, what does it mean ?

    blow me ... ...

  3. #3
    Registered User
    Join Date
    Jul 2003
    Posts
    450
    Thanks for correcting me there. I knew it was specific to C but was confusing an empty list with a void list of parameters. Pulled it off the back of my brain which thanks to CornedBee has been revealed to be defective. Can I get a trade in?

    I don't think
    void variable is legal but
    void * variable is

    again I could be wrong.
    Last edited by curlious; 09-24-2004 at 06:39 AM.

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    void variable1;
    is not valid. Why? Because it would have no meaning. You can't have a variable of no type.

    void *ptr1;
    is valid though. The variable has the type "memory address without any information as to what might be at that address."
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  5. #5
    Never Exist Hermitsky's Avatar
    Join Date
    Jul 2004
    Posts
    149
    oh....... i get it. thanks,CornedBee

    blow me ... ...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using pointers to pointers
    By steve1_rm in forum C Programming
    Replies: 18
    Last Post: 05-29-2008, 05:59 AM
  2. function pointers
    By benhaldor in forum C Programming
    Replies: 4
    Last Post: 08-19-2007, 10:56 AM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  4. Staticly Bound Member Function Pointers
    By Polymorphic OOP in forum C++ Programming
    Replies: 29
    Last Post: 11-28-2002, 01:18 PM