Welcome Guest | Sign in | Register

Home > C Programming > Pointers > Questions and Answers

01. Which of the following gives the memory address of integer variable a?
A. *a; B. a;
C. &a; D. address(a);

Answer and Explanation

Answer: &a;

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
02. Which of the following gives the memory address of a variable pointed to by pointer a?
A. a; B. *a;
C. &a; D. address(a);

Answer and Explanation

Answer: a;

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
03. Which of the following gives the value stored at the address pointed to by pointer a?
A. a; B. val(a);
C. *a; D. &a;

Answer and Explanation

Answer: *a;

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
04. Which of the following is the proper keyword to allocate memory in C?
A. new B. malloc
C. create D. value

Answer and Explanation

Answer: malloc

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
05. Which of the following is the proper keyword to deallocate memory?
A. free B. delete
C. clear D. remove

Answer and Explanation

Answer: free

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
06. Declare a pointer to an integer called address.
A. int address; B. address *int;
C. int *address; D. *int address;

Answer and Explanation

Answer: int *address;

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
07. Assign the address of a float variable balance to the float pointer temp.
A. temp = &balance; B. balance = float temp;
C. Float temp *balance; D. &temp = balance;

Answer and Explanation

Answer: temp = &balance;

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
08. Assign the character value 'W' to the variable pointed to by the char pointer letter.
A. 'W' = *letter; B. letter = "W";
C. letter = *W; D. *letter = 'W';

Answer and Explanation

Answer: *letter = 'W';

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
09. What is the output of the following program segment?

int count = 10, *temp, sum = 0;
temp = &count;
*temp = 20;
temp = ∑
*temp = count;
printf("count = %d, *temp = %d, sum = %d\n", count, *temp, sum );
A. count = 2, *temp = 10, sum = 10 B. count = 20, *temp = 20, sum = 20
C. count = 10, *temp = 2, sum = 10 D. count = 200, *temp = 0.2, sum = 1

Answer and Explanation

Answer: count = 20, *temp = 20, sum = 20

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
10. Declare a pointer to the text string "Hello" called message.
A. char message = "Hello"; B. *message = "Hello";
C. char *message = "Hello"; D. char message = 'Hello';

Answer and Explanation

Answer: char *message = "Hello";

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum



Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.