Govt. Exams
Entrance Exams
The 'inline' keyword (introduced in C99) suggests to the compiler to replace function calls with actual code, reducing call overhead.
Function parameters have function scope, meaning they are accessible throughout the entire function body.
strlen() returns size_t, which is an unsigned integer type used to represent sizes and counts in C.
A function can be called as many times as needed within a program, limited only by memory and stack constraints.
int func(int x) { return x * 2; }
int main() { printf("%d", func(5)); }
func(5) returns 5 * 2 = 10, which is then printed.
Function declaration syntax is: return_type function_name(parameter_list);
In C, functions are defined by specifying the return type followed by the function name and parameters. No specific 'function' keyword is used.
Functions allow code reusability, modularity, and easier maintenance. They break down complex problems into smaller, manageable pieces.