Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What am I missing? How do I remove that space on the last line. #include #include #include #include using namespace std; //method to split string

What am I missing? How do I remove that space on the last line.

#include #include #include #include using namespace std; //method to split string into words vector split(string str, char delimiter) { vector internal; stringstream ss(str); // Turn the string into a stream. string token; while(getline(ss, token, delimiter)) { internal.push_back(token); } return internal; } int main(){ //declaring variables string input; cout res = split(input, ' '); for(int i=0;i

cout

image text in transcribed

1. Compare output Input IDK how that happened. T Enter text: Your output correctly starts with You entered IDE how that happened TTYL 2. Compare output Input IDK how that happened. T Enter text: Your output You entered IDF how that happened TTYL Expanded I don't know how that happened. talk to you later 3. Compare output I'll fix it JK, you know IDK how Input Enter text: Your output You entered I'll fix it JK, you know IDK how Expanded I'll fix it. just kidding you know I don't know how 4. Compare output nput Your bff, my BFF, and her BFF are all there Enter text: Your output You entered Your bff r my BFF and her BFF are all there Expanded Your boff, my best friend forever and her BFF are all there Enter text: Expected output You entered Your bff r my BFF and her BFF are all there Expanded Your bff my best friend forever and her BFF are all there

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions