Function Declaration in C
Вставка
- Опубліковано 18 жов 2024
- C Programming & Data Structures: Function Declaration in C
Topics discussed:
1) Declaration of functions in C language.
2) Is it necessary to declare the function before we use it?
3) What will happen if we use the function before defining it?
C Programming Lectures: goo.gl/7Eh2SS
Follow Neso Academy on Instagram: @nesoacademy(bit.ly/2XP63OE)
Follow me on Instagram: @jaspreetedu(bit.ly/2YX26E5)
Contribute: www.nesoacademy...
Memberships: bit.ly/2U7YSPI
Books: www.nesoacademy...
Website ► www.nesoacademy...
Forum ► forum.nesoacade...
Facebook ► goo.gl/Nt0PmB
Twitter ► / nesoacademy
Music:
Axol x Alex Skrindo - You [NCS Release]
#CProgrammingByNeso #CProgramming #FunctionDeclaration #CFunctions
Dude you are not ordinary lol !!pure genius ❤ . I am doing IT engineering(sem 3) but your every videos helps me a lot .thank you for sharing your precious knowledge
So dude in which semester now you are?
@@user-og9nl5mt1b really brother?
@@user-og9nl5mt1b so sad yrr😢💔
@@user-og9nl5mt1b 😭😭😭
@@user-og9nl5mt1b ain’t no way bro
Skipping online classes for 2months ..and preparing for the exam overnight... Ur vdos just helps a lot bruhhh🔥
You are an amazing teacher! Thank you very much ❤️❤️❤️
Awesome explanation sir .... I can't explain how much you have taught to me .... thanks a lot
Thank you so much
We can first call a function and then define it ..it works for all type of data types except character
Ex : If the function return type is of char and after calling the function we return a value and store it in char type variable then it won't work..
I
I feel I wasted my money to go college. Your teaching level better than my college .Thanks a lot .
i always thought that we need to declare a function before using it. i didn't know the problem was about the conflict between the types. thank you NESO Academy you are the best ever.
Neso academy is the best. Simple and clear explanations .
sir please try to make lecture on computer organisation and architecture pls it helps a lot of your students the way you teach us fabulous....pls try to give the attention on my comment.
Thank you so much sir your explanation is much more understandable than any others
Thank you for explaining the "implicit error"
I found it useful
This lecture needs yours attention to the most
Your explanations are awesome, and examples too.
Thank you! I have 2 questions:
1. If instead of just 'a' the function would return a string of a full sentence, should I still use char or void?
I like the way of teaching
very good ❤️👍
Awesome teaching Sirji🙏🙏🙏
Sir I really like your videos U r so deligent in explaining
Thank you sir well explained now I'm clear with my confusion
I regret that I missed your videos 😔 and now I'm watching them after my final papers.
Thanks❤🌹🌹🌹🌹
Thank you for Crystal clear explanation with relevant examples
Love the way u explain the topics
parameter definition -->
a quantity whose value is selected for the particular circumstances and in relation to which other variable quantities may be expressed.
sir its my earnest request to you please start python as soon as psbl . you guys are phenomenonal
I am not only impressed by the way you teach but with your excellent communication skills as well and the way your words comes out.....I wish I would have that kind of comms skills
girl you're stunning I wish I could marry you
can't thank you enough!
theeeseeeeeeeeeee have helped me so much.
simple yet so much sober+understandable.
You all are just awesome💚
What if we change the return type of function to int? Compiler's assumption becomes correct
u r making functions so easy for us.
Your videos are very helpful.Pleass, make some more video.
This my first video your total tutorial. Superrr
only if i could subscribe this channel twice🙌
Sir what is the difference between declaration of function in main and outside the main
Here in 1:13 minutes, you said function prototype always ends with ; but our program will show error if we use a ; after declaring a function prototype.
Lmao
Please I have a question. How do we use modf function in c language?
What if we actually change the return type of function fun as int? Would it generate the same error of "conflicting types of function" or not?
No, the program will run;
@@RahulSingh-uu7fyhow bro.... different data types right?
You explained it greatly
Hello i got a question here, please. At the level of 2:37, there is a function call which is "char c=fun();" and you said that function call does not take a data type i think so......i am somehow lost at that level.......................
Very good session...nd sir Ur voice is so soothing😍😍
The lectures are awesome can you please provide notes for these lectures
Thank You Sir
Declaring ,calling function are same?as well as defination ,called function are same?
Tq u very much for ur beautiful explanation
Ur amazing in explation
thanks a lot sir
Can u also make playlist on c++ ? please 🙏🙏🙏
Thanks.
1:09 is it true ? check ur example in previous video
Just amazing 😍😍
If compiler thinks the implicit return data type as int, then why still gives same error for a function which has a int return type?
Thanks you sir this video clear my concept well . In function structure I'm little bit confused in syntax what is first declaration or definition 👍
Excellent
Why would the compiler assume that the function's type is an integer? Its clearly been equated to a variable whose datatype is character, if i equate something to a variable whose datatype is character, why would I think that the thing i equated my variable to (the RHS) is an integer? I would think it is a character because the variable can only store strings. Why would the compiler think the data type of the function is an integer when its being equated to a variable with data type character?
Sir plz upload the continuation videos after this one
Thank you
Hats off sir💖
great concepts....
instead 0f char fun() , if i write int fun(), it will give the output.
5:47 I tried when the function returns an integer (ex sum) and is defined below main() and... It worked...?
It got me thinking why do we need the prototype if the compiler will always look for the definition? (Assuming fun() returns integer so the call and definition aren't contradictory)
Explanation is very good in electronics than in this video
thanks sir g
Sir what if we create a function with integer return type......?At 6:00
Please answer
Sir I have a doubt..If the compiler assumes a data type for the function implicitly. Is there any chance that may be sometime the type assumed by the compiler and the type defined by us can be same? Please clarify it.
How do I clear the error 'implicit function declaration'?
thank for teach me
Thank u
Explained meticulously!
Plz continue to make videos
Nice
4:08 as you said every program starts from main() then how can we say that the function is already defined ?? please explain anyone
@Poranki Raj kumar
The compiler start reading your code from the #include and it includes all the library files you have mentioned and it's a downward process and the main execution of a program start from the main() function know the difference. When the compiler finds the function declaration or definition before starting execution of the main() function the Compiler will know that there's a function which will be used in main() function. If you declared or defined a function but you haven't used it (i mean in main function you didn't called or invoked a function) then it will give a warning that u defined a function but not use it
It's possible that compiler assumes 🤔🤔 machines doesn't assume i think
Your all video good
#include
#include
int main()
{
int c,a=12,b=13;
c =fun(a,b);
printf("char is :%d",c);
}
int fun(x,y)
{
return x+y;
}
// I called a fun before defining it....without prototype !!!it is working .....
how ????
I think because the func u called is int
Make it char and try I think it won't work
The best
Sr yr. Video are. Easily. Understandable
Plzzz make. More. Video on C
Also make videos on pointers plz
Sir at 5:54 if we give datatype int instead char in line 8
Will the error be still there
no , the output is displayed just with a warning describing that there is no declaration(prototype).....nice doubt mate..!
Please do a video on linked list
hi im havving this result when im practicing my fonctions , that im geting this messege ""function.c:22:5: note: declared here
int test(){"" how can i solve it??
sir why do you declare function before main body....?
we need to declare it before main when we define it delow main function
you guys rocked 💝💝💝💝💝💝💝💝
Fan from diploma ❤️
What is char?
Sir u also should python as soon as possible
Why are you using int before main , we are not returning any integer in the main function?😑☹️
sir upload full videos
Sir, with out "return 0" how the program is giving output ?
return 0 statment means the code executed with no error it is not necessary
I have a doubt that.... What is the purpose of function ...where we should use it.... Simply we can write a program based on last lecture.. Why we r using function..
Sir... Plz reply me..
If u want to calculate area of rectangle using different values of length and breath ,how will you do? Will u write a program again and again or just call the function you already defined.
If we are using int return type then it is possible to call before declaring??????
yes
Best sir
during execution of the program we know that first program that comes under process is the main function and we have not declared user defined function after the header files ...so how it is creating diffrence in writing function definition before the main function or after.??the first function that will going to be executed will be main and taht time how compiler will going to have a knowledge about the user defined function???
The compiler scans from top to bottom. However, the execution starts from main().
Sir plz upload the videos
Very gooood🫶
hi
Please Hindi mein video daliye
please open the translate please #Naso_Academy
Nhi smajh aaya 😭😭
Only I m do thanks million of trucks
63 vedio
Sir plz plz
I can't put just type of variable as a parameter, codeblocks says it must have a name. Why?
#include
int main()
{
int number;
number=enter_a_number(number);
printf("The number is %d",number);
return 0;
}
int enter_a_number()
{
int number;
printf("Enter a number: ");
scanf("%d",&number);
return number;
}
I can cut int number and paste it as a parameter, but if I type (int) or (int ) it doesn't work, says error: parameter name omitted