Question

. C++ 11.A statement that displays the address of the variable num1 is Question 11 options:...

. C++

11.A statement that displays the address of the variable num1 is

Question 11 options:

a)

cout << &num1;

b)

cout << *num1;

c)

cout << num1;

d)

cout << &(*num1);

12.The statement int *ptr = new int; acquires memory to hold an integer and then

Question 12 options:

a)

sets ptr to point to the allocated memory.

b)

assigns an integer value to the variable called ptr.

c)

initializes the allocated memory to 0.

d)

creates a new pointer called int.

A reason for passing a pointer to a function is

13.Question 13 options:

a)

to avoid the overhead of copying large data structures.

b)

to allow the called function to modify a variable accessible to the calling function.

c)

to allow easy access to data in the function that is being called.

d)

A and B are both true.

15.Object composition is useful for creating a ________ relationship between classes.

Question 15 options:

a)

conditional

b)

friend

c)

has-a

d)

static

16.An array of characters ending with the null terminator is called

Question 16 options:

a)

a string literal.

b)

a C++ String

c)

a C-string.

d)

a string class object.

17.Function templates allow you to create one general version of a function without having to

Question 17 options:

a)

use member functions.

b)

duplicate code to handle multiple data types.

c)

write any code.

d)

use private members.

18.The operation of moving to a particular location in an input file is accomplished through

Question 18 options:

a)

the locate member function.

b)

the seekp member function.

c)

the seekg member function.

d)

the move member function.

19.When used by itself, ________ causes a file's contents to be deleted if the file already exists.

Question 19 options:

a)

ios:app

b)

ios::in

c)

ios::out

d)

All of the above

20.The ________ function can be used to store binary data to a file.

Question 20 options:

a)

binary.out

b)

write

c)

dataout(binary)

d)

put

0 0
Add a comment Improve this question Transcribed image text
Answer #1
11) cout << &num1;
12) sets ptr to point to the allocated memory.
13) A and B are both true.
15) has-a
16) a C-string.
17) duplicate code to handle multiple data types.
18) the seekg member function.
19) ios::out
20) write
Add a comment
Know the answer?
Add Answer to:
. C++ 11.A statement that displays the address of the variable num1 is Question 11 options:...
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
  • 1.What will the following statement output? cout << &num1; A)None of these B)the value stored in...

    1.What will the following statement output? cout << &num1; A)None of these B)the value stored in the variable named num1 C)the number 1 D)the memory address of the variable named num1 E)the string &num1 2. What will the following code output? int number = 888; int *var = &number; cout << var << endl; A)the address of number B)an asterisk followed by 8888 C)8888 D)an asterisk followed by the address of number 3. Assuming ptr is a pointer variable, what...

  • C++ A reason for passing a pointer to a function is Question 13 options: a) to...

    C++ A reason for passing a pointer to a function is Question 13 options: a) to avoid the overhead of copying large data structures. b) to allow the called function to modify a variable accessible to the calling function. c) to allow easy access to data in the function that is being called. d) A and B are both true.

  • Question 27 The following statement ________. cin >> *num3; stores the keyboard input in the variable...

    Question 27 The following statement ________. cin >> *num3; stores the keyboard input in the variable num3 stores the keyboard input into the pointer num3 is illegal in C++ stores the keyboard input into the variable pointed to by num3 None of these Question 28 The following statement ________. int *ptr = new int; results in a compiler error assigns an integer less than 32767 to the variable ptr assigns an address to the variable ptr creates a new pointer...

  • C++ 1. The copy constructor is used for one the following scenarios: I. Initialize one object...

    C++ 1. The copy constructor is used for one the following scenarios: I. Initialize one object from another of the same type. II. Copy an object to pass it as argument to a function. III. Copy an object to return it from a function. Read the following program and answer questions (20 points) #include <iostream> using namespace std; class Line public: int getLength( void); Line( int len // simple constructor Line( const Line &obj) 1/ copy constructor Line (); //...

  • TRUE/FALSE 1. If pl is an integer pointer variable, with the value of 1000, pl++ changes...

    TRUE/FALSE 1. If pl is an integer pointer variable, with the value of 1000, pl++ changes P1 to point to the memory location 1001. ANSWER: T 2. When you return a dynamic array to the freestore, you must include the number of elements in the array 3. You can assign an array to a pointer variable. 4. The size of dynamic arrays must be declared at compile time. 5. int *pl; declares a static variable. ANSWER: F ANSWER: F ANSWER:...

  • I need to get this two last parts of my project done by tonight. If you...

    I need to get this two last parts of my project done by tonight. If you see something wrong with the current code feel free to fix it. Thank you! Project 3 Description In this project, use project 1 and 2 as a starting point and complete the following tasks. Create a C++ project for a daycare. In this project, create a class called child which is defined as follows: private members: string First name string Last name integer Child...

  • c++ question 1. C++ string Class What does the output look like after executing the following...

    c++ question 1. C++ string Class What does the output look like after executing the following statements? std::string numstr = "12"; numstr += "3"; std::cout << numstr << '\n'; A. None of these. B. The snippet has syntax errors. C. 15 D.123 // 2. Let S be a class that allows integers to be stored in its objects like an array. For example, if obj is an object of S, one can write statements like obj[0] = 100; or int...

  • Question 11 pts Fill in the blank. Two functions are defined main.c and MyAge.c   // FILE...

    Question 11 pts Fill in the blank. Two functions are defined main.c and MyAge.c   // FILE main.c main ( ) { _______ int age ; printf ( " the value of age is %d \n", age ) ; } // FILE MyAge.c int age = 10; int MyAge ( ) { } Group of answer choices static external internal extern Flag this Question Question 21 pts Fill in the blank. Two functions are defined main.c and MyAge.c   The below program...

  • Help fast :Assume a variable called orange exists of type Fruit pointer. The Fruit structure is...

    Help fast :Assume a variable called orange exists of type Fruit pointer. The Fruit structure is defined below. For the variable orange, write a statement that assigns a member variable named hasSeeds to 1 typedef struct Fruit struct f a. &(orange.hasSeeds) 1; b. orange.("hasSeeds) 1 c. orange->hasSeeds 1; d. orange.hasSeeds 1; // menber variables Fruit; Q8: When the malloc function is called, the malloc function returns a(n) a. address on the heap b. address on the stack c. address on...

  • The code should be written in C++. I included the Class used for this function. Also,...

    The code should be written in C++. I included the Class used for this function. Also, please fix the main function if necessary. Description: This function de-allocates all memory allocated to INV. This will be the last function to be called (automatically by the compiler) //before the program is exited. This function also erased all data in the data file. There are other functions that add, process and alter the file; the file printed after those functions will have new...

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