Given the declarations below, write a code fragment that allocates a nameless variable for pointer p1 to point to.
int *p1, *p2;

What will be an ideal response?


p1 = new int;
Explanation: Pointer p1 can be used to refer to a variable, so we can use the operator new to create variables that have no identifiers to serve as name, they have only addresses. We assign the address to the pointer variable p1.

Computer Science & Information Technology

You might also like to view...

The Check _____ button inspects your worksheet for features that need additional description for people with disabilities.?

A. ?Accessibility B. ?Readability C. ?Usability D. ?Document

Computer Science & Information Technology

To remove an app from the screen, click and drag the double-headed arrow pointer to the left or to right

Indicate whether the statement is true or false

Computer Science & Information Technology

Double-clicking the ________ of a window maximizes the window or restores the window

A) Navigation pane B) status bar C) title bar D) Quick Access Toolbar

Computer Science & Information Technology

Which of the following may not be found in an XML DTD?

A. tags B. elements C. attributes D. user agents

Computer Science & Information Technology