I have to write a fn squeeze(const string &s, char c)
for ex squeeze("haaaaah" , 'a') should give the output hah
skyyadav 0 Light Poster
Recommended Answers
Jump to PostI have to write a fn
Yes you do, so what problem are you having in writing the function?
Jump to PostFirst of all, it is far simpler than it looks.
The first thing I will point out is that if you need a local copy of the string, then you should take that string by value (instead of const-reference), it is preferrable in general to do so, and it also …
All 8 Replies
nullptr 167 Occasional Poster
skyyadav 0 Light Poster
skyyadav 0 Light Poster
nullptr 167 Occasional Poster
mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster
skyyadav 0 Light Poster
yingdan 0 Newbie Poster
mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.