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

КОМЕНТАРІ • 126

  • @pradeepramola2295
    @pradeepramola2295 6 років тому +151

    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

    • @rsingh6216
      @rsingh6216 3 роки тому +4

      So dude in which semester now you are?

    • @ashikillahi7121
      @ashikillahi7121 3 роки тому +1

      @@user-og9nl5mt1b really brother?

    • @pixabey900
      @pixabey900 3 роки тому

      @@user-og9nl5mt1b so sad yrr😢💔

    • @postcards9047
      @postcards9047 Рік тому

      @@user-og9nl5mt1b 😭😭😭

    • @marcuz8278
      @marcuz8278 Рік тому

      @@user-og9nl5mt1b ain’t no way bro

  • @heartinart._.13
    @heartinart._.13 3 роки тому +11

    Skipping online classes for 2months ..and preparing for the exam overnight... Ur vdos just helps a lot bruhhh🔥

  • @Shorty35956
    @Shorty35956 5 років тому +29

    You are an amazing teacher! Thank you very much ❤️❤️❤️

  • @MahipalSingh-mv8bk
    @MahipalSingh-mv8bk 4 роки тому +17

    Awesome explanation sir .... I can't explain how much you have taught to me .... thanks a lot

  • @jeedikantivenkat7814
    @jeedikantivenkat7814 5 років тому +8

    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

  • @prasanth-pk12
    @prasanth-pk12 3 роки тому +9

    I feel I wasted my money to go college. Your teaching level better than my college .Thanks a lot .

  • @malekkharcha
    @malekkharcha Рік тому +2

    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.

  • @Shank2485
    @Shank2485 3 роки тому +2

    Neso academy is the best. Simple and clear explanations .

  • @User-m8c1z
    @User-m8c1z 5 років тому +15

    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.

  • @abhishekgupta3698
    @abhishekgupta3698 4 роки тому +9

    Thank you so much sir your explanation is much more understandable than any others

  • @devChoco
    @devChoco 2 роки тому +3

    Thank you for explaining the "implicit error"
    I found it useful

  • @aatank1258
    @aatank1258 2 роки тому +1

    This lecture needs yours attention to the most

  • @Vutsman1
    @Vutsman1 3 роки тому +4

    Your explanations are awesome, and examples too.

  • @eladst8411
    @eladst8411 Рік тому +3

    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?

  • @sagarmemane1915
    @sagarmemane1915 3 роки тому +3

    I like the way of teaching
    very good ❤️👍

  • @sujitsatpute3741
    @sujitsatpute3741 3 роки тому +3

    Awesome teaching Sirji🙏🙏🙏

  • @jungleadventure5708
    @jungleadventure5708 2 роки тому +2

    Sir I really like your videos U r so deligent in explaining

  • @elinacooper9627
    @elinacooper9627 4 роки тому +4

    Thank you sir well explained now I'm clear with my confusion

  • @tayyab.sheikh
    @tayyab.sheikh 9 місяців тому +2

    I regret that I missed your videos 😔 and now I'm watching them after my final papers.

  • @MixLover
    @MixLover 2 роки тому

    Thanks❤🌹🌹🌹🌹

  • @SkKhasim-m5l
    @SkKhasim-m5l 8 місяців тому

    Thank you for Crystal clear explanation with relevant examples

  • @user-gi8lt3tc8n
    @user-gi8lt3tc8n 4 роки тому +3

    Love the way u explain the topics

  • @purubhargava8096
    @purubhargava8096 4 роки тому +2

    parameter definition -->
    a quantity whose value is selected for the particular circumstances and in relation to which other variable quantities may be expressed.

  • @prachidantre9863
    @prachidantre9863 3 роки тому +3

    sir its my earnest request to you please start python as soon as psbl . you guys are phenomenonal

  • @monasharma3968
    @monasharma3968 2 роки тому +4

    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

  • @bhoomikasoni3631
    @bhoomikasoni3631 Рік тому +1

    can't thank you enough!
    theeeseeeeeeeeeee have helped me so much.
    simple yet so much sober+understandable.

  • @14dayztimeap8
    @14dayztimeap8 2 роки тому +1

    You all are just awesome💚

  • @varun3748
    @varun3748 4 роки тому +11

    What if we change the return type of function to int? Compiler's assumption becomes correct

  • @shivambhardwaj7545
    @shivambhardwaj7545 3 роки тому

    u r making functions so easy for us.

  • @ismailkhan887
    @ismailkhan887 5 років тому +1

    Your videos are very helpful.Pleass, make some more video.

  • @venkythesmart440
    @venkythesmart440 4 роки тому

    This my first video your total tutorial. Superrr

  • @lakshmisahithikolasani7185
    @lakshmisahithikolasani7185 4 роки тому +6

    only if i could subscribe this channel twice🙌

  • @PROTECHRAHUL
    @PROTECHRAHUL 4 роки тому +4

    Sir what is the difference between declaration of function in main and outside the main

  • @ashishlama16
    @ashishlama16 3 роки тому +2

    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.

  • @aymanadel3470
    @aymanadel3470 3 роки тому +2

    Please I have a question. How do we use modf function in c language?

  • @khushikesarwani1941
    @khushikesarwani1941 2 роки тому +2

    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?

    • @RahulSingh-uu7fy
      @RahulSingh-uu7fy 2 роки тому +2

      No, the program will run;

    • @MINATO-tl6yt
      @MINATO-tl6yt Рік тому

      ​@@RahulSingh-uu7fyhow bro.... different data types right?

  • @28_zaidbinaltaf46
    @28_zaidbinaltaf46 3 роки тому

    You explained it greatly

  • @yanoski9
    @yanoski9 6 місяців тому +2

    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.......................

  • @mysterious8198
    @mysterious8198 3 роки тому

    Very good session...nd sir Ur voice is so soothing😍😍

  • @NishantSingh-br6iu
    @NishantSingh-br6iu 3 роки тому +1

    The lectures are awesome can you please provide notes for these lectures

  • @HelloWorld40408
    @HelloWorld40408 Рік тому

    Thank You Sir

  • @gateeasycse
    @gateeasycse 4 місяці тому

    Declaring ,calling function are same?as well as defination ,called function are same?

  • @sharathsimharaj3117
    @sharathsimharaj3117 3 роки тому

    Tq u very much for ur beautiful explanation

  • @kolakalapudinarasimhareddy5260
    @kolakalapudinarasimhareddy5260 2 роки тому

    Ur amazing in explation

  • @sayanta01
    @sayanta01 5 місяців тому

    thanks a lot sir

  • @rinallokhande2859
    @rinallokhande2859 4 роки тому +2

    Can u also make playlist on c++ ? please 🙏🙏🙏

  • @filip6472
    @filip6472 2 роки тому

    Thanks.

  • @aviericabhishek
    @aviericabhishek 5 років тому +2

    1:09 is it true ? check ur example in previous video

  • @kanchanrathore8003
    @kanchanrathore8003 2 роки тому

    Just amazing 😍😍

  • @prodiptamondal1758
    @prodiptamondal1758 3 роки тому +1

    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?

  • @gayatriprabhune6581
    @gayatriprabhune6581 3 роки тому +3

    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 👍

  • @dhanapaldhanapal2476
    @dhanapaldhanapal2476 2 роки тому

    Excellent

  • @devlala4924
    @devlala4924 3 місяці тому

    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?

  • @saicharithaneelisetty1552
    @saicharithaneelisetty1552 6 років тому +2

    Sir plz upload the continuation videos after this one

  • @anjaliverma7949
    @anjaliverma7949 4 роки тому

    Thank you

  • @ayushpoddar3241
    @ayushpoddar3241 2 роки тому

    Hats off sir💖

  • @Aabara_ka_dabara
    @Aabara_ka_dabara Рік тому

    great concepts....

    • @Aabara_ka_dabara
      @Aabara_ka_dabara Рік тому

      instead 0f char fun() , if i write int fun(), it will give the output.

  • @tariq1028
    @tariq1028 3 роки тому +1

    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)

  • @bandarupallisriharsha5431
    @bandarupallisriharsha5431 6 років тому

    Explanation is very good in electronics than in this video

  • @BrajeshKumar-uh2hi
    @BrajeshKumar-uh2hi Рік тому

    thanks sir g

  • @abhinavsingh9629
    @abhinavsingh9629 2 роки тому

    Sir what if we create a function with integer return type......?At 6:00
    Please answer

  • @swatipradhan8722
    @swatipradhan8722 5 років тому +4

    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.

  • @paulinenanjala4983
    @paulinenanjala4983 2 роки тому +1

    How do I clear the error 'implicit function declaration'?

  • @Gameworld-zo5hx
    @Gameworld-zo5hx 9 місяців тому

    thank for teach me

  • @true4189
    @true4189 4 роки тому

    Thank u

  • @ZainKhan-ki7rm
    @ZainKhan-ki7rm Рік тому

    Explained meticulously!

  • @shaikakhila9738
    @shaikakhila9738 6 років тому

    Plz continue to make videos

  • @MohitKumar-xe9tk
    @MohitKumar-xe9tk 6 років тому +2

    Nice

  • @porankirajkumar4709
    @porankirajkumar4709 4 роки тому +1

    4:08 as you said every program starts from main() then how can we say that the function is already defined ?? please explain anyone

    • @rohishzade4107
      @rohishzade4107 3 роки тому

      @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

  • @invinciblevikas9553
    @invinciblevikas9553 3 роки тому

    It's possible that compiler assumes 🤔🤔 machines doesn't assume i think

  • @ranjeetpalaka7478
    @ranjeetpalaka7478 5 років тому

    Your all video good

  • @Shiva_polishetty
    @Shiva_polishetty 5 років тому +1

    #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 ????

    • @indiancoder8301
      @indiancoder8301 5 років тому +2

      I think because the func u called is int
      Make it char and try I think it won't work

  • @rakeshrakei7970
    @rakeshrakei7970 4 роки тому +1

    The best

  • @nadeemshaikh9257
    @nadeemshaikh9257 6 років тому +1

    Sr yr. Video are. Easily. Understandable
    Plzzz make. More. Video on C

  • @shaikakhila9738
    @shaikakhila9738 6 років тому

    Also make videos on pointers plz

  • @indiancoder8301
    @indiancoder8301 5 років тому +2

    Sir at 5:54 if we give datatype int instead char in line 8
    Will the error be still there

    • @sooryaj1270
      @sooryaj1270 4 роки тому +2

      no , the output is displayed just with a warning describing that there is no declaration(prototype).....nice doubt mate..!

  • @shividhaliwal3354
    @shividhaliwal3354 4 роки тому

    Please do a video on linked list

  • @bobpapa940
    @bobpapa940 2 роки тому

    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??

  • @javeriaansar2053
    @javeriaansar2053 5 років тому +2

    sir why do you declare function before main body....?

    • @ahmednomier6499
      @ahmednomier6499 4 роки тому

      we need to declare it before main when we define it delow main function

  • @sr-sunny-raj
    @sr-sunny-raj 4 роки тому +2

    you guys rocked 💝💝💝💝💝💝💝💝

  • @diplomalife8018
    @diplomalife8018 2 роки тому

    Fan from diploma ❤️

  • @عزالدين-م7ج
    @عزالدين-م7ج 3 роки тому

    What is char?

  • @kuruvellateju9294
    @kuruvellateju9294 3 роки тому

    Sir u also should python as soon as possible

  • @Trafalgar_D_law_
    @Trafalgar_D_law_ 4 роки тому

    Why are you using int before main , we are not returning any integer in the main function?😑☹️

  • @rajivattri20
    @rajivattri20 6 років тому

    sir upload full videos

  • @ganikasarma4616
    @ganikasarma4616 3 роки тому

    Sir, with out "return 0" how the program is giving output ?

    • @Dinesh45444
      @Dinesh45444 2 роки тому +1

      return 0 statment means the code executed with no error it is not necessary

  • @swethavelusamy3875
    @swethavelusamy3875 4 роки тому

    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..

    • @swethavelusamy3875
      @swethavelusamy3875 4 роки тому

      Sir... Plz reply me..

    • @kO_EC
      @kO_EC 3 роки тому

      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.

  • @akshayrode3546
    @akshayrode3546 5 років тому

    If we are using int return type then it is possible to call before declaring??????

  • @sonusambharwal8828
    @sonusambharwal8828 5 років тому

    Best sir

  • @shresthsrivastava5967
    @shresthsrivastava5967 5 років тому +1

    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???

    • @sairajdas6692
      @sairajdas6692 5 років тому +4

      The compiler scans from top to bottom. However, the execution starts from main().

  • @shashikantmaurya1038
    @shashikantmaurya1038 6 років тому

    Sir plz upload the videos

  • @Douagalai-m2f
    @Douagalai-m2f 9 місяців тому

    Very gooood🫶

  • @shaikjameela8096
    @shaikjameela8096 2 роки тому

    hi

  • @reezneb12084
    @reezneb12084 9 місяців тому

    Please Hindi mein video daliye

  • @raachmhamed2233
    @raachmhamed2233 9 місяців тому

    please open the translate please #Naso_Academy

  • @Karansingh-vf7ei
    @Karansingh-vf7ei 3 роки тому +1

    Nhi smajh aaya 😭😭

  • @tajuddin7179
    @tajuddin7179 Рік тому

    Only I m do thanks million of trucks

  • @monikakamble73
    @monikakamble73 2 роки тому

    63 vedio

  • @shashikantmaurya1038
    @shashikantmaurya1038 6 років тому

    Sir plz plz

  • @limitess9539
    @limitess9539 Рік тому

    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