Thread: Function Prototype

  1. #1
    Registered User
    Join Date
    Apr 2012
    Posts
    39

    Function Prototype

    I'm supposed to write a possible function prototype for the following line of code and y is a double:
    f(&y);

    Why would you ever have an "&" right there, and what would the prototype be?

    Thanks

  2. #2
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    Given that '&' is the "address-of" operator:
    Code:
    double x = 0;
    double *x = &x;
    It should be easy to figure out how to change:
    Code:
    double f (double y);
    into what you want.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Best C++ Function Prototype
    By Geometrian in forum C++ Programming
    Replies: 6
    Last Post: 01-21-2011, 09:31 PM
  2. function prototype
    By eurikau in forum C Programming
    Replies: 1
    Last Post: 07-31-2007, 01:19 AM
  3. function prototype
    By shuo in forum C++ Programming
    Replies: 9
    Last Post: 04-19-2007, 09:25 PM
  4. Replies: 13
    Last Post: 08-24-2006, 12:22 AM
  5. Function ... should have prototype ?
    By c-- in forum C Programming
    Replies: 4
    Last Post: 12-27-2001, 10:49 PM