Advanced C | Summary Test
-
The
setjmp()
function behaves as it had:- one entry and one exit
- more than one entry and one exit
- one entry and more then one exit
- more than one entry and more than one exit
-
The following code:
#include <stdio.h> #include <complex.h> int main(void){ float _Complex cplx = 1 + 1i; return 0; }
- will be successfully compiled by ANSI C compatible compiler
- will be successfully compiled by C90 compatible compiler
- in invalid
- will be successfully compiled by C11 compatible compiler
-
The difference between
stat()
andlstat()
function lies in:- different approach to symbolic links
- result types
- parameters numbers
- different approach to directly names
-
The normalized float value:
- has the highest significand’s bit set to
0
- has the highest exponent’s bit set to
0
- has the highest significand’s bit set to
1
- has the highest exponent’s bit set to
0
- has the highest significand’s bit set to
-
The
va_copy()
function is designed to copy:- one instance of
va_list
to another - one variadic parameter to another
- one variadic argument to another
- one variadic function to another
- one instance of
-
The
FP_SUBNORMAL
flag marks a float value that:- exceeds any of IEEE defined limits
- has to be normalized
- has been successfully normalized
- cannot be normalized
-
The
SSIZE_MAX
symbol determines a maximum:- length of source file
- size of any array
- value of
short int
data - length of data transferred by
read()
andwrite()
functions
-
The memory block allocated by
realloc()
:- is fully filled with zeros
- retains its previous content and fills the newly allocated part with zeros
- is fully filled with random value
- retains its previous content and does not initialize then newly allocated part
-
The
ioctl()
function is used to:- set and unset environment variable
- communicate with devices at OS level
- evaluate mantissa length
- setting
scanf() / printf()
conversion modes
-
The
va_arg
, an entity coming from<stdarg.h>
, actually is a:- type
- macro
- variable
- function
-
Assuming that the
x
variable is of typeint
, the following condition:x < x +1
- is invalid
- is always false
- is always true
- is unpredictable
-
What is the expected output of the following code?
#include <stdarg.h> #include <stdio.h> int f(int n, ...){ va_list list; va_start(list,n); char c; while(va_arg(list, int) != 0) c = va_arg(list, int); va_end(list); return c; } int main(void) { printf("[%c]\n", f('a', 'b', 'c', '\0')); return 0; }
b
c
- an empty line
a
-
The
atexit() function:
- may not be invoked more than once
- may be invoked more than once
- may not be invoked when the
_Exit()
function is utilized - may not be invoked when the
exit()
function is utilized
-
Which of the following pairs present valid way of coding UNICODE code-points using hexadecimals?
\u1234
and\U1234ABCD
\w1234abcd
and\w1234
- the code falls in an infinitive loop
\u1234abcd
and \U1234
-
In MS Windows environment the thread’s text has to be placed in a function using the following header:
void thread(LPVOID data)
DWORD WINAPI thread(LPVOID data)
void thread(void)
DWORD WINAPI thread(void)
-
To force the compiler to store the variable inside CPU instead of RAM you can use:
- the
external
specifier - the
const
specifier - the
register
specifier - the
static
specifier
- the
-
The so-called” calling convention ” determines:
- the way in which the programmer builds functions’ interface
- the possible argument names
- the way in which the arguments are put on and cleared off the stack
- the possible function names
-
The following invocation:
sendto(sockfd, buf, len, flags, NULL, 0);
- is an equivalent of
send(sockfd, buf, len);
- is an equivalent of
send(sockfd, buf, len, flags);
- is an equivalent of
send(scokfd, buf);
- is an equivalent of
send(sockfd);
- is an equivalent of
-
The “
st_dev
” filed of “struct stat
” in MS Windows environments reflects:- device location
- the drive number
- 32 bit long device identifier
- device vendor’s name
-
Current rounding mode may be determined by means of the:
fegetround()
functionroundmode()
functionferoundmode()
functiongetround()
function
-
The
volatile
specifier:- tells the compiler to not use the variable
- is obsolete
- suggest the compiler to store the variable in one of CPU registers
- forces the compiler to fetch the variable from memory each time it is read
-
Passing the
NULL
values as the firststrtok()
argument causes- runtime error
- the function to iterate through the string
- the function to repeat last find
- the function to start the find process
-
The
recvfrom()
function retains received data in input buffers if it is invoked with flag:MSG_WAIT
MSG_HOLD
MSG_KEEP
MSG_PEEK
-
One of the following snippet is valid-which one?
void f{return __func__;}
char f{return __func__;}
double f{return __func__;}
char f{return __func__[0];}
-
Assuming that the code was compiled and ran in Unix/Linux environment what is its expected output?
#include <sys/types.h> #include <sys/wait.h> #include <stdio.h> #include <unistd.h> int x = 0; int main(void) { if(fork()){ wait(NULL); printf("%d", x); return 0; }else{ x++; return 0; } }
2
1
0
- an empty line
-
The
MSG_DONTWAIT
flag makes thesendto()
function:- to be invoked in asynchronous way
- return immediately
- scan sent data for specified patterns
- wait for confirmation
-
The structure defined in the following way reflects the content of a system file named:
struct <?> { char *s_name; char **s_aliases; int s_port; char *s_proto; }
- protocols
- services
- password
- hosts
-
A part of a code which may not be executed in more than one thread in the same time is called:
- one-way thread
- subthread
- critical section
- mutexed code
-
The so-called “designated initializer” is a way of initializing:
- vectors
- functions
- indices
- structures
-
If you put a pin in a random place of number line, the distance to closet representable float value is:
- greater than ULP
- not greater than half of ULP
- equal to ULP
- equal to half of ULP
Subscribe
0 Comments
Newest