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);
}
#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);
}
I'm not gay, but I love you bro sincerely from the bottom of my heart.
You and Organic Chemistry.
Bro need conformation 💀
Short , precise and to the point , Damn bro
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.
your typing skill is insane !!😦😦
i got my c exam in few hours thanks
All the best 💯
this was so clear, thank you!!
Please do a video on how to create your own library file that you can #include in your programs
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!
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.
Love from india ❤️❤️✌️✌️
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;
}
Nice Explanation. I wanna be fellow bro.
Very helpful
thank for helping me understand..
Thank's bro
amazing......
We use C lang in the first year please put more content about C , nd I'll be much appreciate
I like how you speed up the video when you're typing.... right!?!
عجزت افهم ليش نحط شي فوق وشي تحت
Thanks sir
hi
I need a count++ for every time you say == function
onbhjh
hi