Write a program that takes a string as input

Assignment Help C/C++ Programming
Reference no: EM13493255

c++ program
Reverse
Write a program that takes a string as input (from the user) and then reverses the contents of the string. Your program should work by using two pointers. The "head" pointer should be set to the address of the first character in the string, and the "tail" pointer should be set to the address of the last character in the string (i.e. the character before the terminating null). The program should swap the characters referenced by these pointers, increment "head" to point to the next character, decrement "tail" to point to the second to last character, and so on, until all characters have been swapped and the entire string reversed.
Hint: Use the length of the string to calculate the address of the last character in the string. Loop until head >= tail. You may have to convert your string variable to an array of char- acters.
Filename: reverse.cpp

Reference no: EM13493255

Questions Cloud

Focusing on the goals of private businesses : Focusing on the goals of private businesses, and the goals of lawmakers for economic progress and economic security, select one example private-sector industry, describe the general business goals by using information on the web sites of one o..
Determine the spheres volume charge density : A nonconducting solid sphere of radius 11.2 cm has a uniform volume charge density. What is the sphere's volume charge density
The construct lifestyle in market segmentation : European Journal of Marketing, 36 (1/2), pp. 51-85. Assess the thesis of the authors in regards to the construct ‘lifestyle'. Examine the other innovations that are presented in the article.
What is the radius of the cylinder : An object is located on the inner side of a spinning cylinder with an angular velocity of 20rad/s. what is the radius of the cylinder
Write a program that takes a string as input : Write a program that takes a string as input (from the user) and then reverses the contents of the string. Your program should work by using two pointers.
Explain how would the retention time of a solute in gas : How would the retention time of a solute in gas chromatography change if the flow rate of the carrier gas is slowed down?
How you would take advantage of this opportunity : Suppose you observe that a three-year, default-free security with an annual coupon rate of 10% and a face value of $1000 has a price today of $1183.50. Is there an arbitrage opportunity? If so,show specifically how you would take advantage of this op..
Produce a diagram of a proposed network : Produce a diagram of a proposed network
Create a chart of t-accounts : Analysts predicted earnings per share (EPS) for your company to be $0.12 at the close of 2011.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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