C function prototypes 🤖
C function prototypes tutorial example explained #C #function #prototype void hello(char[], int); //function prototype int main() { // function prototy...

Bro Code
77.9K views • Oct 6, 2021

About this video
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("\nHello %s", name);
printf("\nYou are %d years old", age);
}
#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("\nHello %s", name);
printf("\nYou are %d years old", age);
}
Tags and Topics
Browse our collection to discover more content in these categories.
Video Information
Views
77.9K
Likes
1.9K
Duration
4:37
Published
Oct 6, 2021
User Reviews
4.7
(15) Related Trending Topics
LIVE TRENDSRelated trending topics. Click any trend to explore more videos.
No specific trending topics match this video yet.
Explore All Trends