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

```
int *p1, *p2;
```

```
p1 = new int;
```

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 Compatibility Checker corrects all problems with features that you have used in PowerPoint 2013 but will not be compatible with previous PowerPoint versions

Indicate whether the statement is true or false

Computer Science & Information Technology

The Reviewing Pane command is located on the ________ tab

A) HOME B) PAGE LAYOUT C) REVIEW D) VIEW

Computer Science & Information Technology