Suppose that a function dynamically allocates a block of memory with a local pointer variable p pointing to the allocated block. Suppose further that there are no other pointers referencing that block of memory, and the function returns without doing a delete on p. Then

A) the pointer p becomes a dangling pointer.
B) the compiler will automatically deal locate the memory pointed to by p.
C) the program will suffer from memory leaks.
D) the returning function will throw the bad_alloc exception.
E) None of the above


C) the program will suffer from memory leaks.

Computer Science & Information Technology

You might also like to view...

A Do Until…Loop structure allows you to specify that an action should repeat until:

a) a specific condition becomes true b) a specific condition becomes false c) a specific condition becomes either true or false d) None of the above

Computer Science & Information Technology

The list container provided by the Standard Template Library is a template version of a

A) singly-linked list. B) doubly-linked list. C) circular-linked list. D) backward-linked list. E) None of the above

Computer Science & Information Technology

Analyze the following code:

``` import javafx.application.Application; import javafx.scene.Scene; import javafx.stage.Stage; import javafx.scene.layout.HBox; import javafx.scene.shape.Circle; public class Test extends Application { @Override // Override the start method in the Application class public void start(Stage primaryStage) { HBox pane = new HBox(5); Circle circle = new Circle(50, 200, 200); pane.getChildren().addAll(circle); circle.setCenterX(100); circle.setCenterY(100); circle.setRadius(50); pane.getChildren().addAll(circle); // Create a scene and place it in the stage Scene scene = new Scene(pane); primaryStage.setTitle("Test"); // Set the stage title primaryStage.setScene(scene); // Place the scene in the stage primaryStage.show(); // Display the stage } /** * The main method is only needed for the IDE with limited * JavaFX support. Not needed for running from the command line. */ public static void main(String[] args) { launch(args); } } ``` a. The program has a compile error since the circle is added to a pane twice. b. The program has a runtime error since the circle is added to a pane twice. c. The program runs fine and displays one circle. d. The program runs fine and displays two circles.

Computer Science & Information Technology

If you wanted to search for all customers who live outside of the USA, you would type _________ "USA" as the criterion in the Country field

A) Between...And B) Not Between...And C) Not D) In

Computer Science & Information Technology