The atexit() function:
Группа выборов ответов
may not be invoked when the _Exit() function is utilized
may be invoked more than once--------------
may not be invoked more than once
may not be invoked when the exit() function is utilized
The following symbol may (in certain circumstances) be taken as an equivalent of:
??'
Группа выборов ответов
a caret----
a tilde
a hash
a parenthesis
The _Bool keyword, introduced by C11, denotes a type which is an equivalent of:
Группа выборов ответов
an unsigned int-------
a boolean
an unsigned char
a void
The following code:
#include <stdio.h>
#include <complex.h>
int main(void) {
float _Complex cplx = 1 + 1i;
return 0;
}
Группа выборов ответов
will be successfully compiled by an ANSI C compatible compiler
will be successfully compiled by a C90 compatible compiler
is invalid
will be successfully compiled by a C11 compatible compiler----
One of the following snippets is valid which one?
Группа выборов ответов
char f{ return __func__[0]; }-----
void f{ return __func__; }
double f{ return __func__; }
char f{ return __func__; }
If the compiler defines a symbol named __STDC_VERSION__ as having a value 199901L., it means that it implements the following standard:
Группа выборов ответов
ANSI C
C90
C89
C99---
Which of the terms is not the name of an arguments–passing convention?
Группа выборов ответов
cdecl
stdcall
pascal
stdpass---
The va_arg, an entity coming from <stdarg.h>, is actually a
Группа выборов ответов
variable
type
Macro-----
function
The "calling convention" determines:
Группа выборов ответов
the possible function names
the way in which the programmer builds the function's interface
the way in which the arguments are put on and cleared off the stack-----
the possible argument names
The va_copy() function is designed to copy:
Группа выборов ответов
one instance of va_list to another-----
one variadic argument to another
one variadic function to another
one variadic parameter to another
Only one of the following statements is valid which one?
Группа выборов ответов
#ifdef __VA_ARGS__
#define VARMAC(...) fprintf(x, __VA_ARGS__)----
fprintf(x, __VA_ARGS__;
char *p = __VA_ARGS__;
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
a----
c
an empty line
A data structure commonly referred to as "LIFO" is actually a:
Группа выборов ответов
tree
list
queue
stack----
The ioctl() function is used to:
Группа выборов ответов
set and unset environment variables
evaluate the mantissa length-----
set scanf()/printf() conversion modes
communicate with devices at OS level
The difference between stat() and lstat() functions lies in:
Группа выборов ответов
their different approaches to symbolic links
their different approaches to directory names----
the result types
the parameter numbers
Which of the expressions can be used to discover that the read() invocation has reached the end of the file?
Группа выборов ответов
read(fd, t, sizeof(t)) < 0
read(fd, t, sizeof(t)) == sizeof(t)----
read(fd, t, sizeof(t)) == 0
read(fd, t, sizeof(t)) > 0
The following invocation:
fileno(stdout)
Группа выборов ответов
returns 0
returns 1-----
returns 2
oes not return any useful value
The "endline translation" is needed because:
Группа выборов ответов
files may contain texts written in different languages
binary files have no lines
no file can be created without it-----
different OSes my use different end of line markings
The st_dev field of struct stat in the MS Windows environment reflects:
Группа выборов ответов
the device vendor's name----
the drive number
the device location
a 32–bit long device identifier
The SSIZE_MAX symbol determines the maximum:
Группа выборов ответов
length of data transferred by the read() and write() functions
value of short int data
length of the source file----
size of any array
The memory block allocated by realloc():
Группа выборов ответов
is fully filled with zeros
retains its previous content and fills the newly allocated part with zeros ]----
retains its previous content and does not initialize the newly allocated part
is fully filled with random values
What is the expected output of the following code?
#include
#include
int main(void) {
char p[] = "ABC";
printf("%ld\n", strchr(p,'B') strrchr(p,'B'));
return 0;
}
Группа выборов ответов
-1
B---
1
0
What is the expected output of the following code?
#include <string.h>
#include <stdio.h>
int main(void) {
char p[] = "10101", *q;
int i = 0;
q = strtok(p,"0");
while(q) {
i++;
q = strtok(NULL,"0");
}
printf("%d\n",i);
return 0;
}
Группа выборов ответов
3---
2
1
the code falls into an infinite loop
Passing the NULL value as the first strtok() argument causes:
Группа выборов ответов
the function to repeat the last find
a runtime error
the function to start the find process
the function to iterate through the string----
Which of the following pairs presents a valid way of coding UNICODE code points using hexadecimals?
Группа выборов ответов
\w1234 and \W1234ABCD
u1234abcd and \U1234
\u1234 and \U1234ABCD----
\w1234abcd and \W1234
The memory block allocated by the malloc() function:
Группа выборов ответов
is filled with random values
is filled with 0xdeadbeef-----
is filled with zeros
is filled with 0xFF
The bzero() function is designed to:
Группа выборов ответов
compare memory blocks with zeros----
fill memory blocks with zeros
find zeroed memory blocks
make platform–dependent variables set to zero
A thread, in the C11 sense, is a function of type:
Группа выборов ответов
void thread(void *data);
int thread(void *data);----
int thread(void);
void *thread(void);
Assuming that the following snippet is executed in the MS Windows environment, its effect is:
putenv("VAR=");
Группа выборов ответов
it remove the VAR from the environment
it set the VAR's value to an empty string----
none
it prints the VAR's value to stdout
The spawn() family functions:
Группа выборов ответов
return to the invoker in the case of an error
return to the invoker in the case of success----
always return to the invoker
never return to the invoker
In the MS Windows environment the thread's text has to be placed in a function using the following header:
Группа выборов ответов
DWORD WINAPI thread(LPVOID data)---
void thread(void)
DWORD WINAPI thread(void)
void thread(LPVOID data)
A function which isn't going to return to the invoker is named:
Группа выборов ответов
CreateThread()
exit()-----
wait()
spawn()
Assuming that the code was compiled and ruan in the 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;
}
}
Группа выборов ответов
1---
0
an empty line
2
A part of a code which may not be executed in more than one thread at the same time is called:
Группа выборов ответов
a one way–thread
a subthread
a critical section---
mutexed code
The current rounding mode may be determined by means of the:
Группа выборов ответов
getround() function
fegetround() function---
feroundmode() function
roundmode() function
f you put a pin in a random place of a number line, the distance to the closest representable float value is:
Группа выборов ответов
greater than ULP
equal to half of ULP
not greater than half of ULP---
equal to ULP
The FP_SUBNORMAL flag marks a float value that:
Группа выборов ответов
exceeds any of the IEEE–defined limits
has been successfully normalized
cannot be normalized
has to be normalized---
The absolute values of numbers representable in a 32–bit IEEE754 number come from the range:
Группа выборов ответов
0.0 .. +inf
2.23e 308 .. 1.8e+308---
1.18e 38 .. 3.4e+38
1.18e 38 .. +inf
Assuming that the x variable is of type int, the following condition:
x < x + 1
A normalized float value:
Группа выборов ответов
has the highest exponent's bit set to 1---
has the highest exponent's bit set to 0
has the highest significand's bit set to 0
has the highest significand's bit set to 1
A +inf result may be produced in effect by dividing:
Группа выборов ответов
a positive float by zero
any float by zero---
any float by –inf
any non–zero float by zero
A structure defined in the following way reflects the contents of a system file named:
struct <?> {
char *s_name;
char **s_aliases;
int s_port;
char *s_proto;
}
Группа выборов ответов
protocols---
services
password
hosts
he accept() function:
Группа выборов ответов
returns the client's IP
returns the server's IP
returns a newly created socket
does not return any useful value---
The MSG_PEEK flag is used in connection with:
Группа выборов ответов
accept()
bind()
socket ()--
recvfrom()
he following invocation:
sendto(sockfd, buf, len, flags, NULL, 0);
Группа выборов ответов
is an equivalent of send(sockfd);
is an equivalent of send(sockfd, buf, len, flags);
is an equivalent of send(sockfd, buf);--
is an equivalent of send(sockfd, buf, len);
he recvfrom() function retains received data in input buffers if it is invoked with the flag:
Группа выборов ответов
MSG_PEEK
MSG_HOLD
MSG_KEEP---
MSG_WAIT
Which of the following is a proper bind() function header?
Группа выборов ответов
int bind(int sockfd, struct sockaddr *addr, socklen_t addrlen);
int bind(int sockfd, struct sockaddr addr, socklen_t addrlen);---
int bind(int sockfd, struct sockaddr addr, socklen_t *addrlen);
int bind(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
The MSG_DONTWAIT flag makes the sendto() function:
Группа выборов ответов
become invoked in an asynchronous way
scan the sent data for specified patterns
return immediately---
wait for confirmation
A phenomenon appearing when more than one side effect occurs in an expression is called:
Группа выборов ответов
an uncertainty point
a side point
a sequence point----
an expression point
The pointer named p, declared in the following way, is:
double * const DBLPTR = malloc(sizeof(double));
Группа выборов ответов
a const–qualified pointer to a const–qualified double
a const–qualified pointer to a double---
invalid
a pointer to const–qualified double
he following snippet:
int f(int i) {
i++;
if(i == 0) goto go_to;
return i;
}
int main(void) {
f(0);
go_to:
return 0;
}
Группа выборов ответов
will cause a compilation error----
is fully correct
will cause a runtime error
will cause an infinite loop
The setjmp() function behaves as if it had:
Группа выборов ответов
more than one entry and more than one exit
one entry and one exit----
one entry and more than one exit
more than one entry and one exit
To force the compiler to store a variable inside the CPU instead of the RAM, you can use:
Группа выборов ответов
the const specifier
the static specifier
the external specifier----
the register specifier
he volatile specifier:
Группа выборов ответов
tells the compiler not to use the variable
suggests that the compiler store the variable in one of the CPU registers----
is obsolete
forces the compiler to fetch the variable from the memory each time it is read