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
sp2606 [1]
3 years ago
11

A function that modifies an array by using pointer arithmetic such as ptr to process every value of the array should have a para

meter that is: a. A nonconstant pointer to nonconstant data. b. A nonconstant pointer to constant data. c. A constant pointer to nonconstant data. d. A constant pointer to constant data.
Computers and Technology
1 answer:
hammer [34]3 years ago
3 0

Answer:

a. A nonconstant pointer to nonconstant data

Explanation:

Pointer can be used to pass an argument by reference. Pointers may be assigned to any integer value. Functions parameters are passed by an array. The function which modifies an array by arithmetic pointer is nonconstant pointer to nonconstant data to process every value in array. Pointer arithmetic allows us to perform integer additions or subtractions for the operation in pointer.

You might be interested in
Write a zip code class that encodes and decodes 5-digit bar codes used by the U.S. Postal Service on envelopes. The class should
8_murik_8 [283]

Answer:

#include<iostream>

#include<string>

using namespace std;

class zip_code

{

private:

int zipcode;

string get_string(int num)

{

string str="";

if(num == 0) return "11000";

if(num>7)

{

str.append("1");

num = num-7;

}

else

str.append("0");

if(num>4)

{

str.append("1");

num = num-4;

}

else

str.append("0");

if(num>2)

{

str.append("1");

num = num-2;

}

else

str.append("0");

if(num>1)

{

str.append("1");

num = num-1;

}

else

str.append("0");

str.append("0");

return str;

}

public:

zip_code(int barcode)

{

if(barcode<10000 || barcode>99999)

cout <<"Invalid Bar code passed to constructor." << endl;

else

zipcode = barcode;

}

zip_code(string barcode)

{

if(barcode.length()>27)

cout <<"Invalid Bar code passed to constructor." << endl;

else

{

int zipper = 0;

string str_local = barcode.substr(1,barcode.length()-2);

for(int i=0; i<str_local.length()-5; i+=5)

{

int local = 0;

local = 7*(str_local[i]-'0') +

       4*(str_local[i+1]-'0') +

       2*(str_local[i+2]-'0') +

       1*(str_local[i+3]-'0');

if(local == 11) local = 0;

       zipper = zipper*10 + local;

}

zipcode = zipper;

}

}

string getZipcode()

{

string str = "1";

int first = zipcode/10000;

int second = (zipcode - first*10000)/1000;

int third = (zipcode - first*10000-second*1000)/100;

int fourth = (zipcode - first*10000-second*1000-third*100)/10;

int fifith = (zipcode - first*10000-second*1000-third*100-fourth*10);

str.append(get_string(first));

str.append(get_string(second));

str.append(get_string(third));

str.append(get_string(fourth));

str.append(get_string(fifith));

str.append("1");

return str;

}

int get_zipCode()

{

return zipcode;

}

};

int main()

{

zip_code z1(123456);

zip_code z2(99504);

cout << z2.getZipcode() << endl;

system("pause");

return 0;

}

4 0
4 years ago
Two friends can share 100 songs from their Bluetooth enabled mobile devices
Umnica [9.8K]

Answer:

A

Explanation:

If they are connected via bluetooth, you can share unlimited amounts of anything.

6 0
3 years ago
"ikev2 requires the use of which of authentication protocol?"
katen-ka-za [31]
Ikev2 requires the use of authentication protocol called Extensible Authentication Protocol (EAP).  It is <span>is a protocol for wireless networks that ampiflies on the authentication methods for the Point-to-Point Protocol (PPP).</span>
4 0
3 years ago
What is the name of the unique identifier assigned to any personal computer that is connected to the internet?
Stolb23 [73]
There is no truly unique identifier assigned to a PC. Any appearance of a unique ID is merely an illusion. The closest thing there is to a unique identifier is a MAC address, which is actually assigned to a network adapter (Ethernet port, wireless radio, etc.) and is usually unique but can be faked
7 0
3 years ago
What is a typical grace period for a credit card...
Schach [20]
It is 20 to 25 days so c is correct
6 0
3 years ago
Read 2 more answers
Other questions:
  • Power point 2016 which chart element provides the boundaries of the graphic?
    6·1 answer
  • Honestly reporting experimental findings is an example of good what?
    7·2 answers
  • Which Windows system utility contains a comprehensive list of the devices connected to your computer and displays warning icons
    8·1 answer
  • Which of the following is NOT a valid declaration for a character string?
    8·1 answer
  • We need ____ pointers to build a linked list.
    6·1 answer
  • Do you think we could use mathematical operators on string values rather than integers or floats? Explain.
    12·1 answer
  • A constructor can be overloaded with more than one function which has the same name but with what two different things
    7·1 answer
  • What is one example of an emerging class of software
    12·1 answer
  • Please help ⊙﹏⊙ thank you &lt;3
    10·2 answers
  • How can touch typing increase productivity of a business?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!