Write a function that copies a source c string

Assignment Help Basic Computer Science
Reference no: EM133270215

Assignment:

Write a function that copies a source C string to a destination character array, with leading and trailing whitespace omitted. The function should return a pointer to the first character of the destination array. An empty string or a string that consists entirely of whitespace results in an empty string in the destination array.

char* trim(char* destination, const char* source);

Files We Give You: A makefile and a sample main program (trim.cpp) to test your solution. The executable file created by a successful build will be named trim.

File You Must Submit: Place your solution code in a file named solution.cpp. This will be the only file that you submit.

Examples

Input: source = " t nboth ends nt" Output: destination = "both ends" Returns: destination

Input: source = "trailing tn" Output: destination = "trailing" Returns: destination

Input: source = " t nnt" Output: destination = "" Returns: destination

Input: source = "" Output: destination = "" Returns: destination

Reference no: EM133270215

Questions Cloud

Denote an hd wallet for the 4th receiving public : 1. How to denote an HD wallet for the 4-th receiving public key for the 2-nd Ethereum account?
What are the six ways to make people like you : From the book, How to Win Friends and Influence People, What are the six ways to make people like you and why is this important to a leader
Deploying and debugging smart contracts of truffle project : Truffle console is useful for deploying and debugging smart contracts of the truffle project. What is a series of commands we type in the truffle console to dep
What does carnegie mean by a drop of honey : What does Carnegie mean by "a drop of honey" when having a difference of opinion or having a problem that needs attention
Write a function that copies a source c string : Write a function that copies a source C string to a destination character array, with leading and trailing whitespace omitted. The function should return a poin
Compare and contrast the actions of cornelius vanderbilt : Compare and contrast the actions of Cornelius Vanderbilt with how the organized crime syndicates are run
What do you do - choose one options : 1. You can set bail and send him to jail to await trial, or 2. You can try a new pretrial release option-a day reporting center-to see
What influences the witness perspective on the situation : When a criminal justice practitioner questions a witness to a robbery, what influences the witness's perspective on the situation
What are the specific areas of risk : What are the specific areas of risk that have been identified by the USDA related to food and agriculture with respect to homeland security

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd