Blue Theme Orange Theme Green Theme Red Theme
 
Team Foundation Server Hosting
Home | Forums | ASP.NET 2.0 Tutorials | Web Services | How Do I...? | Class Browser | WPF Quick Starts | Advertise with Us
 | Consulting  
Submit an Article Submit a Blog 
Search :       Advanced Search »
Home » Blogs Home » Blog Detail

Function Prototype

 by Sivaraman Dhamodaran on Aug 22, 2011

What is Function Prototype?
Comments: 0 Views: 771 Printable Version 

Function Prototyping

Function prototyping is telling the compiler the name of the function, return data type including void, number of parameter it receives and data type of the parameter and the order in which it is supplied. The compiler uses this information at runtime to check the correct type of parameter is supplied in right orders.

There can be function that may not return any value. Also there can be function, which do not collect any parameters. Consider the following function prototype:

float MutiplyDivide(int, int, int);

It tells the compiler that function MultiplyDivide takes three integers as parameters and returns a float. When you implement a function you actually specify the parameter names like shown below:

float MutiplyDivide(int param1, int param2, int param3)

{

            float k;

            //Some Loagic Here

 

            return k;

}

You should also note that the compiler will not restrict you to name parameters in the function prototype. The below prototype is absolutely acceptable:

float MutiplyDivide(int m1, int m2, int d1);

 

 

 

 

 

Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post Here.
 
What do you say about this post? Post a comment here
*Title:
*Comment:
 
Comments not available.
Nevron Gauge for SharePoint
Become a Sponsor

 Blogger's Profile
Age: Not Available
Location:
Title: Systems Engineer
Joined: Oct 21, 2010
Education: Masters Degree
 More Blogs from this Blogger
[Video] OnClose Handler
[Video] Storing and Loading the Window and Toolbar position
Swapping Exe Process
How Exe file is Generated by VS2005 C++ Project?
What is Exe
Header files: Multiple Inclusion problem - Solution B
Header files: Multiple Inclusion problem - Solution A
Header files: Multiple Inclusion problem - Reason
Header files: Multiple Inclusion problem
Header file inclusion techniques
View all »
 Latest Blogs
[Video] OnClose Handler
[Video] Storing and Loading the Window and Toolbar position
The Euclidean Algorithm
Swapping Exe Process
How Exe file is Generated by VS2005 C++ Project?
What is Exe
Header files: Multiple Inclusion problem - Solution B
Header files: Multiple Inclusion problem - Solution A
Header files: Multiple Inclusion problem - Reason
Header files: Multiple Inclusion problem
View all »
 Latest Jobs
More ... 
 Latest Interview Questions
More ... 
6 Months Free & No Setup Fees ASP.NET Hosting!
 © 2012  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.