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
Lena [83]
2 years ago
8

Please explain this code line by line and how the values of each variable changes as you go down the code.

Computers and Technology
1 answer:
Scilla [17]2 years ago
6 0

Answer:

hope this helps. I am also a learner like you. Please cross check my explanation.

Explanation:

#include

#include

using namespace std;

int main()

{

int a[ ] = {0, 0, 0};  //array declared initializing a0=0, a1=0, a3=0

int* p = &a[1]; //pointer p is initialized it will be holding the address of a1 which means when p will be called it will point to whatever is present at the address a1, right now it hold 0.

int* q = &a[0];  //pointer q is initialized it will be holding the address of a0 which means when q will be called it will point to whatever is present at the address a0, right now it hold 0.

q=p; // now q is also pointing towards what p is pointing both holds the same address that is &a[1]

*q=1 ; //&a[0] gets overwritten and now pointer q has integer 1......i am not sure abut this one

p = a; //p is now holding address of complete array a

*p=1; // a gets overwritten and now pointer q has integer 1......i am not sure abut this one  

int*& r = p; //not sure

int** s = &q; s is a double pointer means it has more capacity of storage than single pointer and is now holding address of q

r = *s + 1; //not sure

s= &r; //explained above

**s = 1; //explained above

return 0;

}

You might be interested in
The physical address assigned each network adapter is called its ________.
zysi [14]
MAC address
....................
5 0
3 years ago
Maria works for MegaCorp, a large privately owned company specializing in sales of ball bearings. MegaCorp introduces filtering
ololo11 [35]

Answer:

No, because it would be generally free for private-sector employees by using filtering software to restrict access to some websites.

Explanation:

Maria working for the following Corporation, a major private-owned company that specializes throughout ball bearings production. That corporation establishes filtering software to restrict access to some of these sites linked to non-work, and also some sites with poπnographic images.

So, Maria could not challenge that policy lawfully, as private-sector employees are usually free to always use filtering software to restrict access to some of these Websites

3 0
2 years ago
Which of these are correctly formatted Python tuples? CHECK ALL THAT APPY.
grin007 [14]
I think C is correct I looked into some Python and that would seam like the most logical answer
4 0
2 years ago
Read 2 more answers
In which of the following situations would you want to use a word processing template?
creativ13 [48]
<h2>Answer:</h2>

<u>The correct answer is A. </u><u>You need to write a letter to a company you’d like to work with, and have specific questions to ask.</u>

<h2>Explanation:</h2>

Applying for a job is a very formal type of document which contains all the required and necessary information about a person who wants to apply. So a letter is typed in Microsoft word format to keep the document aligned and beautiful. Word template can make it professional which otherwise becomes hard to apply for a job in the absence of quality editing.

5 0
3 years ago
Read 2 more answers
Define a function group-by-nondecreasing, which takes in a stream of numbers and outputs a stream of lists, which overall has th
Debora [2.8K]

Answer:

def group_by_nondecreasing( *args ) :

     num_list = [arg for arg in args]

     sorted_numlist = sorted( num_list )

     list_stream = [ sorted_numlist, sorted_numlist, sorted_numlist ]

     return list_stream

Explanation:

This python function has the ability to accept multiple and varying amount of arguments. the list comprehension shorten the logical for statement to generate a list of numbers, sorts the list in ascending order by default and duplicates the list in another list.

5 0
3 years ago
Other questions:
  • What are the desirable qualities of a Product Vision?
    11·1 answer
  • We want to construct a memory with 256 bytes in capacity. Assume that each byte has a unique address. (a) How many address lines
    14·1 answer
  • A ____ by a design professional is used to determine the best system to provide the appropriate level and type of protection.
    6·1 answer
  • What is the term for the conversion of a bitmap image to a vector image?
    8·1 answer
  • What test is most similar to binary​
    9·1 answer
  • When searching the web software programs called fetch a few web pages and then they follow the links on those pages and fetch th
    9·2 answers
  • . It has been said that technology will be the end of management. Maybe. How about artificial intelligence
    9·1 answer
  • Avi does not want to save his internet browsing details on his computer. What should he do?
    11·1 answer
  • true or false You are able to change the formatting of a table after it is inserted into a placeholder.
    6·1 answer
  • LAB: Phone number breakdown Given a long long integer representing a 10-digit phone number, output the area code, prefix, and li
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!