Google
 
Webcprogramming.com




An Affiliate of AIHorizon




Quiz: Pointers

If you didn't do as well as you wanted to, be sure to read through Cprogramming.com's tutorial on Pointers in C. Otherwise, double congratulations, pointers are a tricky topic!

1. Which of the following is the proper declaration of a pointer?
A. int x;
B. int &x;
C. ptr x;
D. int *x;

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

3. Which of the following gives the memory address of a pointer a?
A. a;
B. *a;
C. &a;
D. address(a);

4. Which of the following gives the value stored in pointer a?
A. a;
B. val(a);
C. *a;
D. &a;

5. Which of the following is the proper keyword to allocate memory in C?
A. new
B. malloc
C. create
D. value

6. Which of the following is the proper keyword to deallocate memory?
A. free
B. delete
C. clear
D. remove


Quiz

-----
Interested in advertising with us?
Please read our privacy policy.
Copyright © 1997-2005 Cprogramming.com. All rights reserved.

Geodesy Designs