C Programming - 30 - Function prototype

preview_player
Показать описание
What is the need of a function prototype in a c program.
Рекомендации по теме
Комментарии
Автор

Given below are prototypes in C++ of countEven, getInput, replace functions and definition of menu function.
int countEven(int a[ ]);
int getInput( );
void replace(char ch[ ], char ch);
char menu( )
{
char ch;
cin >> ch;
return ch;
}
In main call menu function and store value returned by menu in some variable
If Value returned by menu is
‘C’ call countEven
‘I’ call getInput
‘R’ call replace function
No need to write definition of countEven, getInput and replace function.

iqramalik
Автор

wow, this guy made so much more sense, even though i can barley understand him....

EllixV
Автор

as a theory answer how can i describe function prototype ?

LetCode
Автор

Prabeesh R K are you still on YouTube bro?

lctechnologies
Автор

Hello, thanks for explenation, please i want to know something, i try to make calculate function after main that take int return type and whene i call him in main function, an error occur : calculate is not declared in this scope.
i know that i don't write the prototype of this function but the return type is int !
#HELP

hostname
Автор

sir you can say float calculate(int a, int b) instead of these we can use float calculate(float a, float b) it's right(or)wrong sir

saimuddey
Автор

misleading video, you don't even explain what a prototype is, gave up the video 8 minutes into, waste of time and confusing

frenchmike
Автор

Talks a little about the 'how', but not at all about the 'why'. Wouldn't recommend it.

jangroth