Thread: a pointer to a function question..

  1. #16
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Visalia, CA, USA

  2. #17
    Join Date
    Oct 2007
    Inside my computer
    Quote Originally Posted by transgalactic2 View Post
    why only ptr=add;

    why not ptr=add(int x,int y);  //add is a function we cant hide its signature 
                                                //what if there were two add function but with different signatures
                                                //in such case this line will create an error
    Because that is a declaration, not an assignment.
    It's also possible to create several functions with different parameter lists (with the same name). It's called overloading and is available in C++, but not C.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #18
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    United States
    Well it isn't a declaration either (just to be clear). The code is a mistake if we want to call it anything. The reason you can't do that is because it isn't a valid C statement, and that will stop the compiler every time.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  2. c++ linking problem for x11
    By kron in forum Linux Programming
    Replies: 1
    Last Post: 11-19-2004, 10:18 AM
  3. Function pointer question
    By sbayeta in forum C Programming
    Replies: 9
    Last Post: 08-06-2004, 08:15 AM
  4. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM
  5. qt help
    By Unregistered in forum Linux Programming
    Replies: 1
    Last Post: 04-20-2002, 09:51 AM