Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1. Some of the questions/programs are required to be typed, complied, run and then
observed.
2. If possible try experimenting with concepts revealed by each question.
3. There are 20 objective type questions on ANSI C.
PART - A
With every use of a memory allocation function, what function should be used to release
allocated memory which is no longer needed?
a.) unalloc()
b.) dealloc()
c.) release()
d.) free()
a.) y=
b.) y=
c.) Compiler Error
d.) y=
The definition of a above explicitly initializes its first four elements. Which one of the following
describes how the compiler treats the remaining four elements?
Which one of the following functions is the correct choice for moving blocks of binary data that
are of arbitrary size and position in memory?
a.) memcpy()
b.) memset()
c.) strcpy()
d.) memmove()
a.) 5
b.) 7
c.) 9
d.) 11
Which one of the following provides conceptual support for function calls?
a.) -3
b.) 4
c.) 4 + sizeof ( int )
d.) 4 * sizeof ( int )
a.) 1, 2, 3, 4, 5, 5,
b.) 4, 3, 2, 1, 0, 0,
c.) 5, 4, 3, 2, 1, 0,
d.) 0, 0, 1, 2, 3, 4,
a.) 1
b.) 6
c.) 8
d.) 14
Referring to the sample above, what is MAX_NUM?
Referring to the sample code above, what value will the variable have when
completed?
a.) 0
b.) 1
c.) 2
d.) 3
a.) fg
b.) efg
c.) defg
d.) cdefg
Which one of the following functions returns the string representation from a pointer to a
time_t value?
a.) localtime
b.) gmtime
c.) asctime
d.) ctime
a.) go_cart__
b.) go4it
c.) 4thseason
d.) _what
In terms of code generation, how do the two definitions of buf, both presented above, differ?
a.) The first definition certainly allows the contents of buf to be safely modified at runtime;
the second definition does not.
b.) The first definition is not suitable for usage as an argument to a function call; the second
definition is.
c.) The first definition is not legal because it does not indicate the size of the array to be
allocated; the second definition is legal.
d.) They do not differ -- they are functionally equivalent.
a.) z=0.00
b.) z=1.00
c.) z=1.50
d.) z=2.00
What is wrong with the above code (assuming the call to malloc does not fail)?
How is enum used to define the values of the American coins listed above?