Thread: function prototypes

  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    16

    function prototypes

    can function prototypes be mentioned inside the main function , before the definition of functions? or is it that all prototypes to be mentioned in the beginning of the source code before main() ?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by kawaikx15
    can function prototypes be mentioned inside the main function , before the definition of functions?
    Yes. Next time, write a program and see if it works, then ask to check if your observation is compiler specific.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Function Prototypes
    By askinne2 in forum C Programming
    Replies: 6
    Last Post: 10-01-2010, 01:01 PM
  2. Function prototypes
    By XxPKMNxX in forum C Programming
    Replies: 4
    Last Post: 10-28-2009, 02:33 AM
  3. Function Prototypes
    By Kryota in forum C++ Programming
    Replies: 11
    Last Post: 12-28-2007, 04:52 AM
  4. 2 function prototypes
    By newbie101 in forum C++ Programming
    Replies: 3
    Last Post: 05-09-2006, 05:49 AM
  5. Question about function prototypes
    By Mikecore in forum C Programming
    Replies: 2
    Last Post: 11-20-2005, 05:39 PM

Tags for this Thread