C function prototypes 🤖

Поделиться
HTML-код
  • Опубликовано: 17 окт 2024
  • C function prototypes tutorial example explained
    #C #function #prototype
    void hello(char[], int); //function prototype
    int main()
    {
    // function prototype
    // WHAT IS IT?
    // Function declaration, w/o a body, before main()
    // Ensures that calls to a function are made with the correct arguments
    // IMPORTANT NOTES
    // Many C compilers do not check for parameter matching
    // Missing arguments will result in unexpected behavior
    // A function prototype causes the compiler to flag an error if arguments are missing
    // ADVANTAGES
    // 1. Easier to navigate a program w/ main() at the top
    // 2. Helps with debugging
    // 3. Commonly used in header files
    char name[] = "Bro";
    int age = 21;
    hello(name, age);
    return 0;
    }
    void hello(char name[], int age)
    {
    printf("
    Hello %s", name);
    printf("
    You are %d years old", age);
    }

Комментарии • 27

  • @BroCodez
    @BroCodez  3 года назад +33

    #include
    void hello(char[], int); //function prototype
    int main()
    {
    // function prototype
    // WHAT IS IT?
    // Function declaration, w/o a body, before main()
    // Ensures that calls to a function are made with the correct arguments
    // IMPORTANT NOTES
    // Many C compilers do not check for parameter matching
    // Missing arguments will result in unexpected behavior
    // A function prototype causes the compiler to flag an error if arguments are missing
    // ADVANTAGES
    // 1. Easier to navigate a program w/ main() at the top
    // 2. Helps with debugging
    // 3. Commonly used in header files
    char name[] = "Bro";
    int age = 21;
    hello(name, age);
    return 0;
    }
    void hello(char name[], int age)
    {
    printf("
    Hello %s", name);
    printf("
    You are %d years old", age);
    }

  • @krlo5574
    @krlo5574 8 месяцев назад +17

    I'm not gay, but I love you bro sincerely from the bottom of my heart.
    You and Organic Chemistry.

  • @briankepha
    @briankepha Год назад +21

    Short , precise and to the point , Damn bro

    • @robertdeckard2136
      @robertdeckard2136 Год назад +3

      I know right, usually with these types of videos, it's half an hour long, covers the entire history of programming, and the fifteen relevant seconds are somewhere around the 23-minute mark.

  • @manhcot
    @manhcot 2 года назад +4

    your typing skill is insane !!😦😦

  • @jimbao9760
    @jimbao9760 11 месяцев назад +13

    i got my c exam in few hours thanks

  • @melaniediel7540
    @melaniediel7540 2 года назад +7

    this was so clear, thank you!!

  • @robinpage2730
    @robinpage2730 2 года назад +1

    Please do a video on how to create your own library file that you can #include in your programs

  • @colincazho9725
    @colincazho9725 2 года назад +2

    Hey, how are you able to run the program without first declaring "hello" function before main. Whenever I try to do that, I get a function declaration error. Thanks!

    • @sohailsherkar7770
      @sohailsherkar7770 9 месяцев назад +1

      i know its been a year since u commented but when you were declaring the variables did u add [] to make it an array cuz t hat might be the problem.

  • @rintugayen2435
    @rintugayen2435 Год назад +1

    Love from india ❤️❤️✌️✌️

  • @PSIwolf39
    @PSIwolf39 10 месяцев назад +1

    Here's some code I made for practice:
    #include
    #include
    #include
    #include
    #include
    double power(double, double);
    int main(){
    double result;
    double baseNumber;
    double addedNumber;
    printf("This is the addition calculator program, what is the base number?
    ");
    scanf("%lf", &baseNumber);
    printf("
    What would you like to use as the added number?
    ");
    scanf("%lf", &addedNumber);
    result = power(baseNumber, addedNumber);
    printf("
    Your result is: %.1lf", result);
    }
    double power(double base, double additionalNumber){
    return base + additionalNumber;
    }

  • @siddharthjain6629
    @siddharthjain6629 2 месяца назад

    Nice Explanation. I wanna be fellow bro.

  • @99x-s5k
    @99x-s5k 2 года назад +1

    Very helpful

  • @dominicdaculiat851
    @dominicdaculiat851 2 года назад

    thank for helping me understand..

  • @seif7653
    @seif7653 Год назад

    Thank's bro

  • @omkarmane4510
    @omkarmane4510 2 года назад

    amazing......

  • @bilaltoumir4475
    @bilaltoumir4475 3 года назад +2

    We use C lang in the first year please put more content about C , nd I'll be much appreciate

  • @TheScissorunner
    @TheScissorunner 2 года назад +1

    I like how you speed up the video when you're typing.... right!?!

  • @1rand967
    @1rand967 Год назад

    عجزت افهم ليش نحط شي فوق وشي تحت

  • @zakariyedaauud5527
    @zakariyedaauud5527 3 года назад

    Thanks sir

  • @The_Mad-Ramx
    @The_Mad-Ramx 6 месяцев назад

    hi

  • @justcallmeq8120
    @justcallmeq8120 6 месяцев назад

    I need a count++ for every time you say == function

  • @bayazidbelkhir5316
    @bayazidbelkhir5316 2 года назад

    onbhjh

  • @The_Mad-Ramx
    @The_Mad-Ramx 6 месяцев назад

    hi