What is the purpose of the "connect" function in socket programming?
What is the purpose of the "connect" function in socket programming?A . To accept incoming connectionsB . To close a connectionC . To send data to a serverD . To establish a connection with a remote hostView AnswerAnswer: D Explanation: The "connect" function in socket programming is used to establish...
Which header file should be included in a C program to use variable parameter functions like va_start and va_arg?
Which header file should be included in a C program to use variable parameter functions like va_start and va_arg?A . <stdarg.h>B . <math.h>C . <stdio.h>D . <stdlib.h>View AnswerAnswer: A Explanation: The <stdarg.h> header file should be included to use variable parameter functions.
Which function-like macro is used in <stdarg.h> to retrieve the next argument from the variable argument list?
Which function-like macro is used in <stdarg.h> to retrieve the next argument from the variable argument list?A . va_listB . va_argC . va_endD . va_startView AnswerAnswer: B Explanation: The va_arg macro is used to retrieve the next argument from the variable argument list.
What system call is used to read data from a file in C programming?
What system call is used to read data from a file in C programming?A . lseek()B . read()C . dprintf()D . stat()View AnswerAnswer: B Explanation: The read() system call is used to read data from a file in C programming.
Which function is used to compare two strings in C?
Which function is used to compare two strings in C?A . strncmp()B . strcmp()C . stricmp()D . strcasecmp()View AnswerAnswer: B Explanation: strcmp() is used to compare two strings in C.
Which API is commonly used for thread management in Windows systems?
Which API is commonly used for thread management in Windows systems?A . Windows APIB . WinAPIC . C11 threading modelD . POSIX threadsView AnswerAnswer: B Explanation: WinAPI is commonly used for thread management in Windows systems.
What is the purpose of the C11 threading model in programming?
What is the purpose of the C11 threading model in programming?A . Providing backward compatibility with older threading modelsB . Introducing new complex threading structuresC . Focusing on single-threaded programming onlyD . Simplifying the creation and management of threads in C programmingView AnswerAnswer: D Explanation: The C11 threading model aims...
Which macro should be used to pass the variable argument list from one function to another in a C program?
Which macro should be used to pass the variable argument list from one function to another in a C program?A . va_copyB . va_startC . va_argD . va_endView AnswerAnswer: A Explanation: The va_copy macro is used to pass the variable argument list from one function to another in a C...
What is the purpose of the function socket() in network socket programming?
What is the purpose of the function socket() in network socket programming?A . To establish a connection with a remote serverB . To create a new socketC . To send data over the networkD . To bind a socket to a specific network addressView AnswerAnswer: B Explanation: The function socket()...
What does the term "context switch" refer to in the context of process and thread management?
What does the term "context switch" refer to in the context of process and thread management?A . The process of recompiling code during runtimeB . The process of switching between different threads in a multi-threaded programC . The process of switching between different processes in a multiprocessing systemD . The...