Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
c__test.docx
Скачиваний:
30
Добавлен:
25.02.2016
Размер:
2.09 Mб
Скачать
  1. Which of the following function prototype is perfectly acceptable?

a)int Function(int Tmp = Show());

b)float Function(int Tmp = Show(int, float));

c)Both A and B.

d)float = Show(int, float) Function(Tmp);

e)Int FunctionShow

  1. Where the default values of parameter have to be specified?

a)Function call

b)Function definition

c)Function prototype

d)Both B or C

e)Function value

  1. If the type specified of parameters of a function is followed by an ampersand & that function call is

a. pass by value

b. pass by reference

c. pass by call

d. pass by function

e. none of them

  1. Function templates can accept

a) any type of parameters

b) only one parameter

c) only parameters of the basic type

d) only parameters of the derived type

e) only function

  1. Inline function is ____

a)Functions with same name and different parameters

b)Asks the compiler to copy code into program instead of making function call

c)Function call with omitted parameters

d)Compact way to make overloaded functions

e)Functions that call themselves

  1. Function Overloading is ____

a) Functions with same name and different parameters

b) Asks the compiler to copy code into program instead of making function call

c) Function call with omitted parameters

d) Compact way to make overloaded functions

e) Functions that call themselves

  1. Differences between references and pointers:

a)You cannot have NULL references. You must always be able to assume that a reference is connected to a legitimate piece of storage.

b)Once a reference is initialized to an object, it cannot be changed to refer to another object. Pointers can be pointed to another object at any time.

c)A reference must be initialized when it is created. Pointers can be initialized at any time.

d)References and pointers are similar

e)All of them

  1. Default Arguments

a) Helps to avoid repeating a set of statements many times

b) Function call with omitted parameters

c) A reference must be initialized when it is created. Pointers can be initialized at any time.

d) References and pointers are similar

e)All of them

  1. What is the output of this program?

b)

c)

d)

e)

  1. Unary scope resolution operator is

a) :;

b) ::

c) :&()

d) -&()

e) :&

  1. Recursive function

a)Functions that call themselves

b) Can only solve a base case

c)a and b

d)none of them

e)all of them

  1. Which of the following is the proper declaration of a pointer?

A. int x;

B. int &x;

C. ptr x;

D. int *x;

E. int (x);

  1. Which of the following gives the memory address of integer variable a?

A. *a;

B. a;

C. &a;

D. address(a);

E.—a;

  1. Which of the following gives the memory address of a pointer a?

A. a;

B. *a;

C. &a;

D. address(a);

E.-aa

  1. Which of the following gives the value stored at the address pointed to by the pointer a?

A. a; B. val(a); C. *a; D. &a; E.++a;

  1. Which of the following is the proper keyword to allocate memory?

A. new

B. malloc

C. create

D. value

E.old;

  1. Which of the following is the proper keyword to deallocate memory?

A. free

B. delete

C. clear

D. Remove

E.new;

  1. Which of the following is a static string?

A. Static String

B. "Static String"

C. 'Static String'

D. char string[100];

E.There is no true answere;

  1. Which statement ends all strings?

A. '.'

B. ' '

C. '\0'

D. '\n'

E.}

  1. What is the output?

A.240;

B.310;

C.550;

D.70;

E.74400

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]