write a c++ program tp replace every space in an inputted string(less than 80 characters)with a hyphen(-)
C++ program 2?
This is an easy program and you will have to write it. But, I will tell you what to do.
Check string length is less than or equal to 80.
Read string character by character and test for a space (use ASCII key code) storing your results as you go. When you have a space add a hyphen.
it looks like this:
Read string: I love dogs.
Character read: I
Stored String: I
Read next character: [space]
Stored String I- (This means adding the hyphen to the string).
Now, you are on your own. It's easy.
Reply:Do you want everything in your life to be done for you????
Get your mind to think, don't ask for everything
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment