Question: Part(D)- (2): void process(char [ ], const int size); void main (K char [10] cin >>; process(x,10);} Modify the above code for the following scenario:
Part(D)- (2): void process(char [ ], const int size); void main (K char [10] cin >>; process(x,10);} Modify the above code for the following scenario: We want the user to enter only numbers in this array. If all the values in the array are numbers then the array x should be sent to function process(...) for further processing. If user enters any non-numeric value in this array then it is an exception and x should not be sent to process() instead the code should throw an error message "Array cannot be processed further". You may use following built-in function to check whether a given character is digit or not. It returns true if c is a digit bool isdigit( char c)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
