Question

What is the purpose of the new operator? Select one: a. It is used to allocate...

What is the purpose of the new operator?

Select one:

a. It is used to allocate memory for variables at runtime.

b. It is used to declare a new function.

c. It is used to initialize class member variables.

d. It is used to start a new program.

e. It allows new operators to be created.

Question 2

Not yet answered

Scored out of 1.00

Flag question

Question text

Under what circumstances can you successfully return a pointer from a function?

Select one:

a. When the variable pointed to IS local to the function.

b. When the variable pointed to is defined in the function.

c. When the variable pointed to is NOTlocal to the function.

d. When the variable pointed to is a pointer.

e. When the variable pointed to has been initialized.

Question 3

Not yet answered

Scored out of 1.00

Flag question

Question text

Creating a variable while a program is running is called:

Select one:

a. Run-time variable creation

b. Dynamic memory allocation

c. Dynamic variable allocation

d. Run-time memory allocation

e. Run-time variable definition

Question 4

Not yet answered

Scored out of 1.00

Flag question

Question text

When a program is done with a chunk of dynamically allocated memory, it should free it with the Answer operator.

Question 5

Not yet answered

Scored out of 1.00

Flag question

Question text

When deleting memory that was allocated for an array, you should use the ____________ operator.

Select one:

a. new

b. delete

c. delete []

d. new []

e. remove []

Question 6

Not yet answered

Scored out of 1.00

Flag question

Question text

The members of a struct must be all of the same type.

Select one:

True

False

Question 7

Not yet answered

Scored out of 1.00

Flag question

Question text

A struct can be used to return multiple values from a function using a single return statement.

Select one:

True

False

Question 8

Not yet answered

Scored out of 2.00

Flag question

Question text

To dynamically allocate memory for an array named numbers that would hold size integers, you would code it as:

Select one:

a. int numbers[size];

b. int * numbers = new int(size);

c. new int numbers(size);

d. int * numbers = new int[size];

e. new int numbers[size];

0 0
Add a comment Improve this question Transcribed image text
Answer #1
Question 1
a. It is used to allocate memory for variables at runtime.

Question 2
c. When the variable pointed to is NOT local to the function.

Question 3
c. Dynamic variable allocation

Question 4
delete

Question 5
c. delete []

Question 6
False

Question 7
True

Question 8
d. int * numbers = new int[size];

Add a comment
Know the answer?
Add Answer to:
What is the purpose of the new operator? Select one: a. It is used to allocate...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I need help on this Systems review please! it's due by midnight monday. Question 1 Not...

    I need help on this Systems review please! it's due by midnight monday. Question 1 Not yet answered Points out of 1.00 Flag question Question text Using these declarations: int * numberPointers[3]; int * pointer; int number; Which of the following statements would generate a warning or error? Select one: a. number = pointer; b. *pointer = number; c. pointer = numberPointers; d. numberPointers[2] = &number; e. a., b., and d. f. a. and c. Question 2 Not yet answered...

  • What instrument is used for food canning? Question 1 Not yet answered Select one: O a....

    What instrument is used for food canning? Question 1 Not yet answered Select one: O a. autoclave Points out of 1.00 b. oven P Flag question c. regenerator d. steamer Question 4 When performing a gram stain, what is the purpose of heating the slide once the bacteria have been added? Not yet answered Points out of 1.00 Flag question Select one: a. kill the balleria b. attach the bacteria to the slide c. increase the permeability of the bacteria...

  • According to Keynesian theory, the most important determinant of saving and consumption is Select one: a....

    According to Keynesian theory, the most important determinant of saving and consumption is Select one: a. the level of real income. b. the stock of liquid assets. c. the stock of durable goods in the consumer's possession. d. the level of consumer indebtedness. Question 5 Not yet answered Marked out of 1.00 Flag question Question text In the Keynesian model, planned investment is inversely related to Select one: a. the interest rate. b. the level of income. c. the wage...

  • Write the code to dynamically allocate ONE integer variable using calloc (contiguous allocation) or malloc (memory...

    Write the code to dynamically allocate ONE integer variable using calloc (contiguous allocation) or malloc (memory allocation) and have it pointed to by a pointer (of type int * ) named ptr_1. Use ptr_1 to assign the number 7 to that dynamically allocated integer, and in another line use printf to output the contents of that dynamically allocated integer variable. Write the code to dynamically allocate an integer array of length 5 using calloc or malloc and have it pointed...

  • All of the following are true regarding NK cells EXCEPT Select one: a. they are found...

    All of the following are true regarding NK cells EXCEPT Select one: a. they are found in tissues of the lymphatic system. b. they have the ability to kill infected body cells and some tumor cells. c. they are a type of lymphocyte. d. they release toxic substances that cause cell lysis or apoptosis. e. they destroy infected body cells by phagocytosis. Question 67 Not yet answered Marked out of 1.00 Flag question Question text Which of the following antibodies...

  • Question 1 Not yet answered Marked out of 1.00 Flag question Question text SQL is a...

    Question 1 Not yet answered Marked out of 1.00 Flag question Question text SQL is a programming language for web-site development. Select one: a. TRUE b. FALSE Question 2 Not yet answered Marked out of 1.00 Flag question Question text Moral dimensions of the information age do NOT include _____. Select one: a. Information rights and obligations b. Accountability and control. c. Information safety d. Property rights and obligations Question 3 Not yet answered Marked out of 1.00 Flag question...

  • Which of the following is true of transcription, but not replication? Select one: a. It requires...

    Which of the following is true of transcription, but not replication? Select one: a. It requires polymerase to catalyze the process. b. All of these are true for both transcription and replication. c. It requires promoters to initiate the process. d. It requires a primer to initiate the process. Clear my choice Question 6 Not yet answered Marked out of 1.00 Flag question Question text Which of the following is/are true of promoters? Select one: a. they contain both exons...

  • The Fed undertakes defensive open-market operations Select one: when it wants to change monetary policy. when...

    The Fed undertakes defensive open-market operations Select one: when it wants to change monetary policy. when it wants to change fiscal policy. to offset a permanent change in money demand. because of seasonal effects or to offset a temporary change in money demand. Question 22 Not yet answered Marked out of 1.00 Flag question Question text Which of the following is NOT a financial intermediary? Select one: A government treasury. A mutual fund. A commercial bank. A savings institution. Question...

  • Fracking involves the ______drilling to extract oil and natural gas from the rock. Select one: a....

    Fracking involves the ______drilling to extract oil and natural gas from the rock. Select one: a. vertical b. lateral c. horizontal Question 7 Not yet answered Marked out of 1.00 Flag question Question text Higher-priced fossil fuels usually _____ overall global economic activity, all else being equal. Select one: a. has no effect on b. mean less c. mean more d. impacts the currency exchange rate Question 8 Not yet answered Marked out of 1.00 Flag question Question text Hydraulic...

  • Question 1 Not yet answered Marked out of 1.00 Flag question Question text Which of the...

    Question 1 Not yet answered Marked out of 1.00 Flag question Question text Which of the following keywords is useful for skipping to the next iteration of a loop? Select one: a. do b. break c. switch d. continue e. while Clear my choice Question 2 Not yet answered Marked out of 1.00 Flag question Question text Consider the following line of Java code. System.out.println("Hello, World!"); "out" is which of the following? Select one: a. a statement b. a class...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT