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
kotegsom [21]
3 years ago
7

Pointers are addresses and have a numerical value. You can print out the value of a pointer as cout << (unsigned)(p). Writ

e a program to compare p, p + 1, q, and q + 1, where p is an int* and q is a double*. Explain the results.
Computers and Technology
1 answer:
lukranit [14]3 years ago
8 0

Answer:

#include <iostream>

using namespace std;

int main() {

  int i = 2;

  double j = 3;

 

  int *p = &i;

  double *q = &j;

 

  cout << "p = " << p << ", p+1 = " << p+1 << endl;

  cout << "q = " << q << ", q+1 = " << q+1 << endl;

  return 0;

}

Explanation:

In C++, pointers are variables or data types that hold the location of another variable in memory. It is denoted by asterisks in between the data type and pointer name during declaration.

The C++ source code above defines two pointers, "p" which is an integer pointer and "q", a double. The reference of the variables i and j are assigned to p and q respectively and the out of the pointers are the location of the i and j values in memory.

You might be interested in
Determine the number of cache sets (S), tag bits (t), set index bits (s), and block offset bits (b) for a 1024-byte 4-way set as
Cerrena [4.2K]

Answer:

The answer is The Cache Sets (S) = 32, Tag bits (t)=24, Set index bits(s) = 5 and Block offset bits (b) = 3

Explanation:

Solution

Given Data:

Physical address = 32 bit (memory address)

Cache size = 1024 bytes

Block size = 8 bytes

Now

It is a 4 way set associative mapping, so the set size becomes 4 blocks.

Thus

Number of blocks = cache size/block size

=1024/8

=128

The number of blocks = 128

=2^7

The number of sets = No of blocks/set size

=128/4

= 32

Hence the number of sets = 32

←Block ←number→

Tag → Set number→Block offset

←32 bit→

Now, =

The block offset = Log₂ (block size)

=Log₂⁸ = Log₂^2^3 =3

Then

Set number pc nothing but set index number

Set number = Log₂ (sets) = log₂³² =5

The remaining bits are tag bits.

Thus

Tag bits = Memory -Address Bits- (Block offset bits + set number bits)

= 32 - (3+5)

=32-8

=24

So,

Tag bits = 24

Therefore

The Cache Sets = 32

Tag bits =24

Set index bits = 5

Block offset bits = 3

Note: ←32 bits→

Tag 24 → Set index  5→Block offset 3

7 0
3 years ago
Why are you unable to modify the budget file, when you have the allow full control ntfs permission?
Alinara [238K]

I don't really know the perfect answer to this but I would say because of todays technonlogy


3 0
3 years ago
Fundamental of Computer Science
Anastaziya [24]

Answer:

Coding and Hardware Hacking

Explanation:

You can learn coding just as well through a online class or even on the internet through yo*tube than an in person class whereas it would be alot easier learning hardware hacking in person because you are given the opportunity to ask and can be corrected for small mistakes due to the task being manual. Coding can be learnt online independently if needed although so can hardware hacking but having a teacher to correct you and teach you handy tricks from their experience will get you further in that sense.

3 0
2 years ago
Which of the following statement is False? 1 point Context free language is the subset of context sensitive language Regular lan
alisha [4.7K]

Answer:

Context-sensitive language is a subset of context-free language

Explanation:

Considering the available options, the statement that is considered wrong is "Context-sensitive language is a subset of context-free language."

This is because generally every regular language can be produced through the means of context-free grammar, while context-free language can be produced through the means of context-sensitive grammar, and at the same time, context-sensitive grammars are produced through the means of Recursively innumerable.

Hence, the correct answer in this correct answer to the question is the last option *Context-sensitive language is a subset of context-free langage

3 0
3 years ago
1. Which of the following options will allow you to insert a quick table? (1 point) Insert ribbon &gt; Shapes drop-down menu
emmasim [6.3K]
Quick tables are tables<span> that are stored in galleries as building blocks and can be reused and accessed at any time.</span>
The following option will allow you to insert a quick table:
Insert ribbon -> Table drop-down menu

Yous should click on the ribbon (tab) Insert and then from the Table drop-down in the Tables group, select Quick Tables.
5 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following is a malicious program that can replicate and spread from computer to computer?
    8·2 answers
  • What so the term used to describe how many bits are used in each pixel?
    7·1 answer
  • Which of these expressions evaluates to 4.0?
    12·2 answers
  • When someone registers a domain name that is a company's trademark, hoping to resell it to the company at an exorbitant profit,
    14·2 answers
  • Explain how each of the five types of prewriting assist a writer in getting started. please make it short.
    15·1 answer
  • How can volunteering yo help plan fundraiser for your team or club be a way to develop your strengths?
    13·1 answer
  • HELP PLZ !!
    13·1 answer
  • Searching for a particular record in a database is called “querying the data.”<br> True<br> False
    9·2 answers
  • HI How are you anyways are any of you intreseted in my giveaway
    7·2 answers
  • Brainly Question
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!