Question: C++ homework exercise: Remove leading and trailing blank spaces from a map. Write a C++ function prototyped as void blanksOut(map & data); Function blanksOut takes

C++ homework exercise:

Remove leading and trailing blank spaces from a map.

Write a C++ function prototyped as

void blanksOut(map & data);

Function blanksOut takes a map. It removes all leading and trailing blanks from the string values in the map. Function blanksOut must not add or remove any keys from the given map. For example,

map m;

m[33] = x y ;

m[40] = aaa;

m[51] = zzz;

blanksOut(m);

cout << m[33] << endl; //prints x y

cout << m[40] << endl; //prints aaa

cout << m[51] << endl; //prints zzz

How should this be done?

Thank you for any help.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!