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 statements is true regarding ARPANET? Select 3 options. It was a product of Bell Laboratories and was int
vlada-n [284]

Answer:

2. It was created to connect geographically dispersed researchers with high powered research computers.

3. The first message was sent through ARPANET in 1969 and it was decommissioned in 1990.

5. It led to the development of the Internet.

Explanation:

4 0
3 years ago
What happens to testosterone levels of those who lose chess tournaments?
Norma-Jean [14]

Answer:they go below an unhealthy level

Explanation:

6 0
2 years ago
Simpson is trying to solve an equation related to converting a decimal number to its hexadecimal form. He decides to utilize the
Murljashka [212]

Answer:

the answer is A.

6 0
3 years ago
What is MS-Word? Write some versions of MS-Word.
shtirl [24]
Ms- word it is , hope it was helpful
8 0
3 years ago
Read 2 more answers
In saving a Visual Basic project properly , which of the following: two components part are involved ?
alina1380 [7]

Answer:

C) Project and Form

Explanation:

In saving a Visual Basic project properly, the following: two components part that is involved are:

1. Project - this is the project file that will be saved in the computer's memory. On the toolbar of a Visual Basic Editor, there is a "Save Project File" icon, which will be clicked to save a Project file.

2. File - the is the Visual Basic Editor's user interface. Just like "window" in Microsoft Office, it is the space used in writing or building the project file.

4 0
2 years ago
Other questions:
  • Universal Containers is tracking the interviewer's ratings of candidate in Salesforce. They would like to easily link the Candid
    9·1 answer
  • Write the definition of a function printDottedLine, which has no parameters and doesn't return anything. The function prints to
    10·1 answer
  • What are the properties of magnetic field​
    8·1 answer
  • If a code word is defined to be a sequence of different letters chosen from the 10 letters A, B, C, D, E, F, G, H, I, and J, wha
    15·1 answer
  • If you wanted a smartphone with the fewest restrictions on application development which smartphone operating system should you
    9·1 answer
  • Android OS "AFTER" Alpha.<br><br> A. Bubblegum<br><br> B. Beta<br><br> C. Berry<br><br> D. Buzz Cola
    10·1 answer
  • If the tax percent is 15% and tax is $36 and percent discount is 10, what is the cost price?​
    12·1 answer
  • The process of learning by making mistakes and by trial and error is called _____.
    6·1 answer
  • And, or, not are examples of boolean logic
    5·1 answer
  • Ninety percent of the fastest-growing jobs require some kind of postsecondary education.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!