returns a pointer to an array that contains a null-terminated sequence of characters (i.e., a C-string) representing the current value of the string object.
In C++98 it was required that "a program shall not alter any of the characters in this sequence". This was encouraged by returning a const char* .
IN C++11, the "pointer returned points to the internal array currently used by the string object to store the characters that conform its value", and I believe the requirement not to modify its contents has been dropped. Is this true?
Is this code OK in C++11?

Answers

Answer 1

Yes, in C++11, the requirement not to modify the contents of the internal array returned by the c_str() function has been dropped.

The c_str() method returns a pointer to a null-terminated character array that represents the current value of the string object. The pointer is a const char* type, indicating that the contents of the array should not be modified.

The method `c_str()` returns a `const char*` in both C++98 and C++11, which still encourages not altering the characters. In C++11, the data() method was introduced, which returns a pointer to the internal array currently used by the string object to store the characters that conform its value. Unlike c_str(), the data() method is not required to return a const char*, meaning that the contents of the array can be modified.

It is important to note that modifying the contents of the internal array can have unintended consequences, such as affecting the behavior of other functions that depend on the string object's value. Therefore, it is still recommended to use the const char* version of c_str() if you do not intend to modify the contents of the string.

To summarize, in C++11:

The c_str() method still returns a const char*, but the requirement not to modify the contents of the internal array has been dropped.

The data() method returns a pointer to the internal array, which is no longer required to be a const char*, allowing modifications to the array.

Modifying the contents of the internal array can have unintended consequences and should be avoided unless necessary.

Know more about the array click here:

https://brainly.com/question/13107940

#SPJ11


Related Questions

How do you interpret and analyze photographs? What method comes most
naturally to you when interpreting and analyzing photographic works? Identify and
discuss the methods and strategies that you use to interpret and analyze
photographs.

Answers

Answer:

You interpret and analyze photographs by observing detail.

Explanation:

Manipulating Images: Which aspect helps you to change the luminescence of your image?

Answers

Answer:

the aspect that help you change the luminescence of your image is iframe

Which Creative Commons license type allows others to use and build upon work non-commercially, provided that they credit original author and maintain the same licensing?

Answers

Answer:

Creative Commons license type allows others to use and build upon work non-commercially, provided that they credit original author and maintain the same licensing is described below in detail.

Explanation:

Attribution-Non financially-ShareAlike

This permission lets others adapt, remix, and develop upon your work non-financially, as long as they charge you and license their new inventions under identical times. There are six separate license classes, scheduled from most to least licensed. the material in any mechanism or arrangement, so long as attribution is given to the originator.

Which area of government regulations do the Fair Credit and Reporting Act
(FCRA) and the Gramm-Leach-Bliley Act (GLB) relate to?
A. Advertising
B. Health and safety
C. Privacy and security
D. Employment and labor

Answers

Answer:   C. Privacy and security

Explanation:  100% correct

REALLY EASY NEED HELP!! REWARD BRAINLIEST

Answers

Answer:

c

Explanation:

Answer: It is the first one

Explanation:

Write a program to allow user to perform any of these list operation given in a menu. The menu is: a) Append an element b) Insert an element c) Modify an existing element d) Delete an existing element with a given value e) Sort the list in descending order f) Display the list.

Answers

Answer:

c

Explanation:

Alice just wrote a new app using Python. She tested her code and noticed some of her lines of code are out of order. Which principal of programing should Alice review?

Hand coding
Line coding
Planning & Analysis
Sequencing

Answers

Answer:

Sequencing

Explanation:

I have taken the test

5. What is the significance of the EXIT DO and EXIT FOR statements?​

Answers

Answer:

Exit Do transfers control to the statement following the Loop statement. When used within nested Do...Loop statements, EXIT DO transfers control to the loop that is one nested level above the loop where it occurs.

When used within nested For loops, EXIT FOR transfers control to the loop that is one nested level above the loop where it occurs.

Explanation:

I HOPE it can help....

Page No
Date T 1 1
Ist
ament Write a program in java to find the area and
perimeter of right angled triangle by using function argument.




Answers

Answer:

ila bgfffsg hqhffa hhfw ygga gha yqvvty1uh' fttyavt h5tfauv gtta76rq

What are Layers in computer class 7. no scams please​

Answers

Answer:

It means and organisation programming into separate functional components that interact in some sequential and hierarchical way, with each layer usually having an interface only to the layer above it and the layer below it.

Choose the correct qurey to remove a record with names "John" in the persons table
(a) Delete from persons where name="John";(b) Delete from table1 where name="John";(c) Delet from persons where name="John";(d) Delet from persons where name="Alex";

Answers

Answer:

a

Explanation:

The correct syntax would be:

DELETE FROM persons WHERE name='John'

i.e., use single quotes. Uppercase keywords is not required but preferred by many.

List out two ways to execute the script.​

Answers

Answer:

1) Execute Shell Script Using File Name. Use the shell script file name to execute it either by using it's relative path or absolute path as shown below

2) Execute Shell Script Using Source Command.

Determine if true or false Goal Seek immediately attempts to apply the function to the adjacent cells.

Answers

Answer:

The answer is "False".

Explanation:

This function the part of Excel, that allows a way to resolve the desirable result by manipulating an underlying expectation. This function is also called What-if-Analysis, which is used to test, and an error approach to address the problem by linking guesses before the answer comes.  On the Data tab, throughout the Data Tool category, and select Target Check it provides a    reference that includes a formula to also be solved throughout the Set cell box.

Please help

Measure the thickness of a razor blade using a vernier caliper and screw gauge. What is the lowest count of these instruments? Which measuring
Instrument is more accurate? You can take multiple blades and stack them together, then measure thickness, and find out the average thickness.

Answers

Answer:

Is this question related to computers and technology?

Need help ASAP

Thankss + BRAINLIST only for correct answers

Answers

Answer:

The purpose to the user is to buy items online.

The purpose to the creator is to have a worldwide service chain to deliver packages.

Vising this website gives access to the items consumers need and allows them to get them shipped right to their door.

It was made so the creator can lots of money along with making a lot of jobs to slow the unemployment rate.

Explanation:

I pulled a lot of this from my head and reading about schollarships Amazon has for students. Amazon is a shopping website. Therefore the user can buy things and it gives the creator money along with making jobs for others.

[4]
) Describe what is involved in the clearing of bank cheques which the bank has collected in the
course of the day.


Plz any answer need it quickly help me if you know

Answers

Answer:

The clearing process begins with the deposit of a cheque in a bank. ... The cheque is passed for payment if the funds are available and the banker is satisfied about the genuineness of the instrument. The cheques that are unpaid are returned to the presenting bank through another clearing called the Return Clearing.

hopes this helps you?????????

Explanation:

function of printer and speaker​

Answers

Nepal .... Free Fire

What is the difference, if any, between a social media strategist and a social media specialist?

A. They are very similar occupations, except that social media specialists tend to have more training.

B. A social media strategist determines how an organization will maintain a social media presence, and the specialist creates the content.

C. There is no difference—these are the same job with slightly different titles.

D. A social media specialist determines how an organization will maintain a social media presence, and the strategist creates the content.

Thank you!

Answers

The answer is D you welcome :D

A social media strategist is an expert who is involved in determining the presence of an organization over the social media; whereas, a specialist is involved in creating the content for social media.

What is social media?

The use of computer networks and internet for the purpose of sharing and expressing one's views with the connections over such platform is known as a social media.

A social media strategist, for an organization, will be involved in maintenance of the social media activeness of the organization; whereas, the content for such presence is in the hands of a specialist.

Hence, option B holds true regarding the roles of handling social media of an organization.

Learn more about social media here:

https://brainly.com/question/18958181

#SPJ2

5. Which part regulates the amount of light that passes up toward the eyepiece?
A. stage
C. diaphragm
B.eyepiece
D. revolving nosepiece
the tot​

Answers

Answer:

C. diaphragm

Explanation:

Microscope is very important instrument in biology and use to magnify the specimen or other biological objects.

Eyepiece, stage, diaphragm and  revolving nosepiece are some of the important part of the microscope with different functions. such as Eyepiece carry the Ocular lens that helps to look the specimen, stage allows light to pass through, diaphragm regulates the amount of light reaches the eyepiece, and revolving nosepiece are use to change magnification.

So, Diaphragm controls the light that passes up toward the eyepiece and help in viewing the specimen. Diaphragm is located below the stage and above the condenser.

Hence, the correct answer is "C. diaphragm".

Answer:

C. Diaphragm is the answer.

Explanation:

#Bonjour

In your own words, describe innovation.

Answers

Answer:

Something that revolutionizes a product

Explanation:

Innovation typically means completely change something that makes everyone wow. A example of this would be a car, the innovational car would have fridge in the back seat. (No current cars have this)

Hope this helps and make sure to thank me!

Question #5
Multiple Choice
What is used within an HTML tag for additional information?
O attribute
O anchor
O hyperlink
metadata

Answers

Answer: Attribute

Explanation: Attribute is used in HTML tags for additional information. Correct on Edg 2021.

Answer: attribute

Edge '23

who developed vacuum tube and when?​

Answers

Answer:

In 1904, John Ambrose Fleming invented the first vacuum tube.

Explanation:

Jon Ambrose Flemming invented the vacuum tube in 1904

Write the Python programs for the
following:
To input a number and check if it is
even or odd number​

Answers

Answer:

num = int(input("Enter a number: "))

if (num % 2) == 0:

print("{0} is Even number". format(num))

else:

print("{0} is Odd number". format(num))

A virus which deceive the user by acting as a legitimate file.

Answers

Answer:

A Trojan virus

Explanation:

It acts like a bona fide application or file to trick you. It seeks to deceive you into loading and executing the malware on your device

1
Select the correct answer from each drop-down menu.
Correctly identify the following software design concepts.
The following are some commonly used software design concepts:
-structural partitioning
-control hierarchy
-Modularity
-Abstraction
refers to the concept that software architecture has the ability to divide into modules and that each
module can be examined independently.
-Refinement
-Modularity
-Abstraction
-Control hierarchy
is a process that elaborates on each design component until it reaches the coding details.
-Software procedure
-Structural partitioning
-Data Structure
allows designers to split a program structure horizontally and vertically.
-Software architecture
-Structural partitioning
-Modularity
-Data Structure
represents logical relationships between individual data elements.

Answers

Answer:

1. Modularity.

2. Refinement.

3. Structural partitioning.

4. Data Structure.

Explanation:

A software development life cycle (SDLC) can be defined as a strategic process or methodology that defines the key steps or stages for creating and implementing high quality software applications. There are six (6) main stages in the creation of a software and these are;

1. Planning.

2. Analysis.

3. Design.

4. Development (coding).

5. Deployment.

6. Maintenance.

One of the most important steps in the software development life cycle (SDLC) is design. It is the third step of SDLC and comes immediately after the analysis stage.

Basically, method design is the stage where the software developer describes the features, architecture and functions of the proposed solution in accordance with a standard. Some of the models or techniques used in the design of a software are;

Modularity: refers to the concept that software architecture has the ability to divide into modules and that eachmodule can be examined independently. Refinement: is a process that elaborates on each design component until it reaches the coding details.Structural partitioning: allows designers to split a program structure horizontally and vertically.Data Structure: represents logical relationships between individual data elements.

47. Which of these examples demonstrates good netiquette?
Typing a comment on a video detailing how boring and poorly made it is.

A-Sending an email without a salutation or a signature.

B-Posting a blog article about how stuck-up your peers are.

C-Being straightforward and truthful in all electronic communications.

Answers

Answer:

typing it, on a video detailing how boring and poorly made it is

Explanation:

this is an example of good netiquette because they are criticizing the video game and what good netiquette is is making a comment relevant to the original message. the original message being the video game

What is the difference between the casual and consultative conversation? Why is it important for a person to know the difference between the two?​

Answers

Answer:

The answer is below

Explanation:

Casual conversation is a form of conversation that occurs between friends and families. There are no specific rules or manner in which the participants speak to each other. It is otherwise known as Informal Conversation.

Consultative conversation on the other hand is a form of conversation that occurs between people who have a close relationship but not actual friends or families.

For example, people involved in this type of conversation are the likes of Doctors and Patients, Counsellors and Students, etc. It is often considered a Semi-formal conversation.

The reason a person needs to know the difference between the two styles of conversation is for individuals to know how to present and conduct themselves appropriately during the conversation.

which of the following can be represented by a sequence of bits. 1. An integer 2. An alphanumeric character 3. A machine language instruction

Answers

Answer:

all of them

Explanation:

In a computer program, this is how numbers, text and program instructions are stored.

Which of the following is an event handler?

scanning a credit card when you shop

displaying a message

clicking a mouse button

moving a mouse

Answers

That which accurately describes an event handler is this:

B. Displaying a message

What is an event handler?

An event handler refers to a system that can be used to verify the input by a user. An event handler can also be used to see the browsing actions and other histories executed by a user.

Displaying a message fits in as an example of an event handler because it is through this means that one can see the input and user actions that were done some time ago. An event handler is a very vital necessity in programming activities. So, option B fits the meaning of an event handler.

Learn more about an event handler here:

https://brainly.com/question/20169706

#SPJ1

Answer:

Displaying a message

Explanation:

'Using more formatting options improves a document.' Do you agree with this statement? Why or why not

Answers

Answer:

Yes, I agree with the given statement: 'Using more formatting options improves a document.'

Explanation:

Formatting improves the readability of documents for end users.

Formatting features like aligning text vertically and horizontally, changing margin and line spacing change the layout of page in the document that makes a document look more presentable.

So, yes, I agree with the given statement: 'Using more formatting options improves a document.'

Other Questions
electromagnetic write up of the brave little toaster movie in what chamber of the u.s. congress do democrats currently have control by the slimmest of margins? Find the derivative of the function f(x, y) = arctan(y/x) at point (3, 3) in the direction the function increases most rapidly. Select the correct text in the passage. Which sentence in the excerpt the best supports the idea that the government has an obligation to provide certain things to its citizens?Excerpt from message to the Congress in special session July 4, 1861 Select the correct statement.Stack canaries stop all buffer overflow exploits by adding a random value to the stack that helps detect if the return address was modified.Stack canaries make buffer overflow attacks impossible by rearranging the memory inside of a process so that the stack grows away from the return address, rather than towards it.Stack canaries make buffer overflow attacks more difficult by adding a random value to the stack that helps detect if the return address was modified.Stack canaries make buffer overflow attacks more difficult by rearranging the memory inside of a process so that the stack grows away from the return address, rather than towards it. The major impact of product innovation tends to be on the firms' revenues, while that of process innovation tends to be on costs. True or False if you were making water (h2o) from oxygen (o2) and hydrogen (h2), would it be an advantage to increase the pressure? Using the MATLAB Help menu, discuss how the following functions are used. Create a simple example, and demonstrate the proper use of the function. a. ABS (X) b. TIC, TOC c. SIZE (x) d. FIX (x) e. FLOOR (x) f. CEIL (x) g. CALENDAR Given the following exponential function, identify whether the change represents growth or decay, and determine the percentage rate of increase or decrease. Y=8800(1. 573)^x The dance team sold tickets to their performance. Student tickets cost $5 and adult tickets cost $7. The dance team sold 57 tickets and made $395. Find the number of students and adult tickets sold a grocer wants to mix two kinds of candy. one kind slls for 0.95 per pound and the other sells for 190 per pound. He wants to mix a total of 23 pounds and sell it for $1.90 per pound. How many pounds of each kind should he use in the new mix? Transcription makes the product: aDNA bRNA cProteinPlsss help me A mixture of three noble gases has a total pressure of 1. 25 atm. The individual pressures exerted by neon and argon are 0. 68 atm and 0. 35 atm, respectively. What is the partial pressure of the third gas, helium? An A&M scientist monitors an endangered species of frog over a period of 36 months. The regression equation describes the change in frog population, flx), for each month, x. S(x) - .0523 25x2 +6.34x + 2 Answer the following questions. (just put the 1. How many frogs were there when the scientist started? number) (just put the 2. What is the approximate frog population in month 17? number) (just put 3. In what month will the frog population be above 400 frogs? the number) An energy production company has the following information regarding the acquisition of new gas-turbine equipment.Purchase price = $780,000Transoceanic shipping and delivery cost = $4,300Installation cost (1 technician at $2,000 per day for 4 days) = $6,400Tax recovery period = 16 yearsBook depreciation recovery period = 8 yearsSalvage value = 12% of purchase priceOperating cost (with technician) = $185,000 per yearThe manager of the department asked your friend in accounting to enter the appropriate data into the tax-accounting program. What are the values of B, n, and S in depreciating the asset for tax purposes that he should enter?The value of B is determined to be $ .The value of S is determined to be $ .The value of n is determined to be years. would the continuous assay of alkaline phosphatase (kinetics lab) with pnpp as a substrate work if the ph of the buffer is changed from 8 to 5? why? Which of the following statements are true of subject variables?A. Subject variables cannot be manipulated by the experimenters.B. Subject variables are considered to be "independent variables" by some but not all researchers, despite the fact that they are not manipulated.C. Subject variables refer to qualities of the participants themselves and are traditionally used to group participants based on those qualities or traits.D. All of the above.E. A and C only. 10.) what is the freezing point of an aqueous solution that boils at 106.5oc? The conducting path between the right hand and the left hand can be modeled as a 12 cm-diameter, 180cm-long cylinder. The average resistivity of the interior of the human body is 4.7(Omega*m) . Dry skin has a much higher resistivity, but skin resistance can be made negligible by soaking the hands in salt water. If skin resistance is neglected, what potential difference between the hands is needed for a lethal shock of 100 mA across the chest? Your result shows that even small potential differences can produce dangerous currents when the skin is wet. 1. Do you think that Joness appearance helped her or hurt her in the effort to unionize?2. Why did getting publicity help the union cause? 3. Why did management and law-enforcement offi-cials fear Jones?38 Unit 4, Chapter 14