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]
4 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]4 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
List out the storage measurements units of a computer .<br><br>​
xxTIMURxx [149]

Answer:

Computer storage and memory is often measured in megabytes (MB) and gigabytes (GB). A medium-sized novel contains about 1 MB of information. 1 MB is 1,024 kilobytes, or 1,048,576 (1024x1024) bytes, not one million byte

3 0
3 years ago
Read 2 more answers
Most source code is typically available on the internet in tarball format or as a git repository. True or false?
Greeley [361]

Most source code is typically available on the internet in tarball format or as a git repository. Therefore, it's true.

<h3>What is a source code?</h3>

It should be noted that a source code simply means programming statement that area created by the programmer and saved in a file.

In this case, most source code is typically available on the internet in tarball format or as a git repository. Therefore, it's true.

Learn more about source code on:

brainly.com/question/4593389

#SPJ12

4 0
2 years ago
Question 1 Excel is a tool used to A create a spreadsheet B design a brochure C make a presentation D write a letter
aev [14]

Q1- it is A: Create a spreadsheet


8 0
4 years ago
Unlike other malware, a ____ is heavily dependent upon the user for its survival. trojan worm rootkit virus
KatRina [158]
A virus is dependent on the user
7 0
4 years ago
Suppose v is an array with 100 int elements. If 100 is assigned to v[100], what happens?
grigory [225]

Answer:

The answer is LETTER C.

Explanation:

<em>An exception will be thrown when the statement is executed, because </em>

<em>arrays store multiple values in a single variable. Arrays use numbered indexes.</em>

7 0
3 years ago
Other questions:
  • Stan is looking at cloud computing options for his business needs. He wants a model that helps his business customers and client
    12·2 answers
  • Every type of internet service requires a connection and monthly payment to a(n): isp voip lms mmorpg
    9·1 answer
  • _______ computing refers to applications and services that run on a distributed network using virtualized resources.
    14·1 answer
  • 1. A formula =A1+B2 is in cell D8. If you copy that formula to cell D9, what is the new formula in cell D9?
    7·1 answer
  • ? Assessment
    10·1 answer
  • How do you suppose a request travels from one computer to another? How does the request know where to go?
    8·1 answer
  • In Linux, users are internally represented using a unique number called user ID or uid.
    9·1 answer
  • A thesaurus is an example of a(n)
    5·2 answers
  • NEED HELP ASAP
    13·2 answers
  • what is the least expensive way to connect five computers using a wired network to a router that has only four network ports?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!