- equals
- str_compare
- string_cmp
Explanation:
The strcmp function is a pre-defined function found within the "string.h" header file. Its purpose is to compare two strings. If the strings are identical, it will yield a return value of 0. In case the first string is deemed greater than the second, a positive integer greater than 0 is returned; otherwise, a negative value is returned.
2) What is passed when we pass an array as a function argument?
- Base address of an array
- Address of the last element of array
- First value of elements in array
- All value of element in array
Explanation:
When the array name is passed as an argument to a function, it carries the base address of the array, which can then be modified within the main function.
3) Which function finds the first occurrence of a substring in another string?
- strchr
- strnset
- strstr
- None of these.
Explanation:
The initial instance of a subsequence within a different string is located using the strstr function.
4) What is the built-in library function for adjusting the allocated dynamic memory size.
- calloc
- malloc
- realloc
- resize
Explanation:
realloc is a standard library function used to modify the size of dynamically allocated memory. Unlike malloc and calloc, which only allocate memory without resizing capabilities, realloc allows for adjusting the memory size as needed. It's important to note that there is no predefined function named resize available for this purpose.
5) Which keyword is used to transfer control from a function back to the calling function?
- return
- go back
- switch
- goto
Explanation:
In C programming, the return statement halts the function's execution and sends a value back to the calling function. The control flow shifts to the calling function immediately after the function call.