C Programming - Declarations and Initializations - Discussion

Discussion Forum : Declarations and Initializations - General Questions (Q.No. 11)
11.
When we mention the prototype of a function?
Defining
Declaring
Prototyping
Calling
Answer: Option
Explanation:

A function prototype in C or C++ is a declaration of a function that omits the function body but does specify the function's name, argument types and return type.

While a function definition specifies what a function does, a function prototype can be thought of as specifying its interface.

Discussion:
46 comments Page 2 of 5.

Shubham said:   10 years ago
Prototypes are just like declarative statements which tell the compiler that the type of the input and type of the parameter and what the function is doing. They are like interface to complier.

Revathy said:   1 decade ago
int a;
is the declaration- it simply assigns the datatype for the variable

int a=10; is the definition- it assigns the value for the variable- the value given should match d datatype

Balaji said:   10 years ago
Hi friends:

Can you explain this program?

in()
{ int arr[]={ 1,2,3,4 };
int *ptr ;;;;
ptr++ = arr;
printf("%d,%d",ptr[2],arr[2]);
return 0;
}

Manali said:   1 decade ago
The answer could be "Prototyping".

Then what is the basic difference between function declaration & function prototyping then ?

Thanks.

Pradeep kumar said:   1 decade ago
#include<stdio.h>
int main()
{
printf("Welcome to IndiaBIX.com..!");
return 0;
}

What is the error in this program?

Sandipgatkal said:   8 years ago
@Vikas.

defining and initializing
int a=20;

defining without initialization :
int a;

initializing already defined variable a
a=20;
(1)

Shanker said:   1 decade ago
Definition of prototype means declaration of function. It's tell the compiler -this type of function are used in a program.

Lodu said:   1 decade ago
Prototype means we specifies the interface of that declared function. And we will use that function for coherent task.

Amar said:   1 decade ago
Prototype means we specifies the interface of that declared function. And we will use that function for coherent task.

Manmeet said:   1 decade ago
Prototype means blue print of a function. It means in our function what type of arguments we require.


Post your comments here:

Your comments will be displayed after verification.