subject

Write a function named duplicate that uses dynamic storage allocation to create a copy of a string. For example, the call p = duplicate(str);would allocate space for a string of the same length of str, copy the contents of str into the new string, and return a pointer to it. Have duplicate return a null pointer if the memory allocation fails. Also what is the type of p?

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 00:00
What season was better from fortnite?
Answers: 2
question
Computers and Technology, 23.06.2019 01:20
Me with this program in c++ ! computers represent color by combining sub-colors red, green, and blue (rgb). each sub-color's value can range from 0 to 255. thus (255, 0, 0) is bright red. (130, 0, 130) is a medium purple. (0, 0, 0) is black, (255, 255, 255) is white, and (40, 40, 40) is a dark gray. (130, 50, 130) is a faded purple, due to the (50, 50, 50) gray part. (in other word, equal amounts of red, green, blue yield gray).given values for red, green, and blue, remove the gray part. ex: if the input is 130 50 130, the output is: 80 0 80. thus, find the smallest value, and then subtract it from all three values, thus removing the gray.
Answers: 3
question
Computers and Technology, 23.06.2019 20:00
Me ajude por favor , coloquei uma senha e não consigo tira-la no chorme
Answers: 2
question
Computers and Technology, 23.06.2019 23:30
What are "open-loop" and "closed-loop" systems
Answers: 1
You know the right answer?
Write a function named duplicate that uses dynamic storage allocation to create a copy of a string....
Questions
question
Mathematics, 05.05.2020 03:54
question
Mathematics, 05.05.2020 03:54
question
Mathematics, 05.05.2020 03:54
question
Mathematics, 05.05.2020 03:54
question
Mathematics, 05.05.2020 03:54
question
Mathematics, 05.05.2020 03:54
Questions on the website: 13722361