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.

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

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

Thanks.

Ankita said:   1 decade ago
Function Declaration and function prototyping is nothing but one and the same thing.

It was easy for programmers to call the function with incorrect.

Parameters which needless to say had disastrous runtime consequences.

Thus ANSI C mandates function prototypes as the method for function declaration.

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?

Niharika said:   1 decade ago
What is the difference between prototyping and declaring?

Banu said:   1 decade ago
Prototype is just declaring the function not declare the body.

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

DHANUNJAY said:   1 decade ago
Prototype is nothing but an outlook, by seeing it we can able to understand what is the matter that it is going to represent in the program. It just says the information about a particular declared variable or a function. I think your dbt was clarified.

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;
}

Athira Prasannan said:   10 years ago
Hai friends,

Can you explain prototype?

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.


Post your comments here:

Your comments will be displayed after verification.