Function | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 3

Function

Can someone explain me difference between function prototype and function definition

7th Jan 2018, 9:24 AM
Dipankar Verma
Dipankar Verma - avatar
5 Réponses
+ 12
A function definition cannot be called unless the function is declared. Thefunction prototype and the function definition must agree EXACTLY on the return type, the name, and the parameters. The only difference between the function prototype and the function header is a semicolon 
7th Jan 2018, 11:30 AM
Abhivarshini Maddala
Abhivarshini Maddala - avatar
+ 2
Thats is diffrence between function prototype and a function implementation
7th Jan 2018, 10:56 AM
Dipankar Verma
Dipankar Verma - avatar
+ 1
Hmmm can u also help me with the position and uses of a function prototype and function header
7th Jan 2018, 3:07 PM
Dipankar Verma
Dipankar Verma - avatar
+ 1
fun(); is function deceleration which tells compiler that we have made a function fun() and fun() { } is function defination which tells the compiler about the operations that are to be performed by the function.In order for your program to work it should should satisfy following conditions: 1)return type should be same 2)no. and type of arguments should be same You can simply copy function name along with parameters and return type and paste it above your program with a semicolon to declere a function
16th Jan 2018, 5:05 PM
Kumar Amresh