1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Trava [24]
3 years ago
7

Would these statements cause an error? Why or why not? int year = 2019; int yearNext = 2020; int & ref = year; & ref = y

earNext;
Computers and Technology
1 answer:
zalisa [80]3 years ago
3 0

Answer: YES

Explanation:

int year=2019;

int yearNext=2020;

 int &ref=year;

<em>&ref=yearNext</em>; {This line leads to error as references cannot be reassigned}

(//compilation error: lvalue required as left operand of assignment

) lvalue(&ref) is not something which can be assigned.

To get this better, here are the difference between pointers and reference variables

Pointers

Pointers can be incremented

Array can be formed with pointers

Pointers can be reassigned

Pointer can be declared as void  

Reference variable

References cannot be incremented

Array cannot be formed with references

References cannot be reassigned as references shares the address of the variable its assigned

References can never be void

You might be interested in
Which of the following tasks could be implemented as a filter using only a constant amount of memory (e.g., a couple of int or d
Nesterboy [21]

Answer:

Print the sum of the squares of the n numbers

Print the percentage of numbers greater than the average of the n numbers

Print the median f n numbers

Explanation:

The computer programs have different configurations based on the assigned tasks. The constant amount of memory is used by the cache. This is the new technology in the computer software which consumes only small amount of memory and activates once the task is assigned to it.

4 0
3 years ago
If you want to create a line of code that will not appear in the interpreter, what symbol should begin the line?
kirill115 [55]

Answer:

endl

Explanation:

Note that endl must be free of quotation marks; otherwise, the program will treat it as a string.. The \n Character. The other way to break a line in C++ is to use the newline character

5 0
2 years ago
To download a webpage, the web browser copies files and transfer them to your ____
Ganezh [65]

Computer is your best answer.


If you download the files, they will show up either on your computer home screen, or in the 'downloads' section of your computer files.



hope this helps

7 0
3 years ago
Read 2 more answers
What does c++ programming mean?
cestrela7 [59]

Answer:

It's an internal joke to say the language is basically C with some extra stuff (like classes)

the "++" is short for

C += 1 or

C = C + 1 which is a common calculation among programmers so they named it C++ to be a more commercial and attractive name than "C with classes"

Explanation:

8 0
2 years ago
What is the depth of the following tree?
atroni [7]

Answer:

the answer for the question is D.

4 0
2 years ago
Other questions:
  • A user reports that nothing happens when he or she attempts to print from the computer at his desk. This points to a possible pr
    11·2 answers
  • A mobile device has stopped receiving automatic OS updates that until recently were pushed to the device.
    7·2 answers
  • ____ devices are high-performance storage systems that are connected individually to a network to provide storage for the comput
    5·1 answer
  • A vacuum tube that contains a grid can be classified as a A. rectifier B. triode C. pentode D. diode
    12·1 answer
  • Fill in the blanks to make the factorial function return the factorial of n. Then, print the first 10 factorials (from 0 to 9) w
    6·1 answer
  • Generally speaking, what is a “best practice"?
    13·1 answer
  • JAVA CODE.
    6·1 answer
  • What is the main difference between the ICD-10 annual revision released by the WHO and the ICD-10-CM/PCS annual revision release
    11·1 answer
  • Can some one help me with this please
    5·1 answer
  • One of the most notable impacts of IT on business is improved
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!