Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Learn Mysql The Easy Way A Beginner Friendly Guide

Authors: Kiet Huynh

1st Edition

B0CNY7143T, 979-8869761545

More Books

Students also viewed these Databases questions