Question: Question #2: Write a function named replaceBlanks that accepts a pointer to a C-string (an array of characters with a NULL terminating character) and it

 Question \#2: Write a function named "replaceBlanks" that accepts a pointer

Question \#2: Write a function named "replaceBlanks" that accepts a pointer to a C-string (an array of characters with a NULL terminating character) and it will replace all blanks in that C-string array with question mark ('?'). It will return three values: - the number of blanks that it has replaced with '?' - the number of '?' that was already in the C-string - the boolean flag that is true if after replacement, the C-string is all '?' and false otherwise. For example, here are examples of C-string and its expected return values "One Two Three" will become "One?Two?Three" and it will return 2 blanks, 8 question mark and false "??" will become "????" and it will return 2 blanks, 2 question marks and true will become "?" and it will return 1 blank, 9 question mark and true will become "?" and it will return blank, 1 question mark and true will become "1" and it will return blank, question mark and false will become "n and it will return 8 blank, 0 question mark and false will become "1?" and it will return blank, 1 question mark and false will become "1?" and it will return 1 blank, 0 question mark and false

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!