This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: appropriate test coverage? s. Keyboard input t. File input u. Randomly generated values v. All of the above 6. A pointer variable can contain: w. The address of a valid object or variable x. The value NULL y. The address of a deleted object z. A random address value aa. All of the above bb. A, B or D 7. Which of the following assigns the address of value to the pointer p1? cc. *p1 = &value; dd. p1 = value; ee. p1 = &value; ff. &p1 = *value; 8. What is the output of the following code fragment? int v1=2, v2=-1, *p1, *p2; p1 = & v1; p2= & v2; p2=p1; cout << *p2 << endl; gg. 2 hh. -1 ii. -2 jj. 1 9. Given that p1 is a pointer to a string, which of the following are legal statements? kk. p1 = new int; ll. cout << *p1; mm. p1 = new char; nn. *p1 = new string; oo. all of the above pp. B and D 10. What is the output of the following code? int *p1, *p2; p1 = new int; p2 = new int; *p1 = 11; *p2 = 0; p2 = p1; cout << *p1 <<" " << *p2 << endl; qq. 11 0 rr. 0 11 ss. 11 11 tt. 0 0...
View Full Document
- Spring '05
- Computer Science, Trigraph, new int, executable file, Computer Science II