You will need to develop a C++ program that removes whitespace characters from an input string. You will need to create a function str_cleanup() that takes a parameter of string type as the input and returns the modified string with whitespace characters (tabs/spaces) removed. As an example, your program execution should look like this: Enter a string: Hello World, Happy Holidays! The output string is: HelloWorld,HappyHolidays! You are not allowed to use any built-in library functions to remove whitespaces. Hint: A string is an array of characters. You can work with a string object as if it was a character-array
You will need to develop a C++ program that removes whitespace
characters from an input string. You will need to create a function str_cleanup() that takes a
parameter of string type as the input and returns the modified string with whitespace
characters (tabs/spaces) removed. As an example, your program execution should look like this:
Enter a string: Hello World, Happy Holidays!
The output string is: HelloWorld,HappyHolidays!
You are not allowed to use any built-in library functions to remove whitespaces.
Hint: A string is an array of characters. You can work with a string object as if it was a
character-array
Step by step
Solved in 3 steps
Thank you so much, this makes sense going through it! I just have one more question about functions that I'm still a bit confused about. What is the difference between user-defined functions vs built-in library functions?