m with two user defined functions. The first function named “functionWithArray” takes two user input arguments of character types and return True if first argument is smaller than the second argument (alphabetically) and returns False otherwise. Write the second function named “functionWithPointers” which behaves like the first functions but uses pointers to receive the arguments. You may assume that both character arrays contain only lower-case letters, and no blanks or other nonalphabetic characters. Write a suitable Main function to test these two functions. Sample Output: Enter First String: C++Programming
This exercise assesses the skills required to develop user defined functions, and pointers.
The cod must have comment .
Exercise 1
Write a C++ program with two user defined functions. The first function named “functionWithArray” takes two user input arguments of character types and return True if first argument is smaller than the second argument (alphabetically) and returns False otherwise. Write the second function named “functionWithPointers” which behaves like the first functions but uses pointers to receive the arguments.
You may assume that both character arrays contain only lower-case letters, and no blanks or other nonalphabetic characters. Write a suitable Main function to test these two functions.
Sample Output:
Enter First String: C++
Enter Second String: JavaProgramming
According to functionWithArrays: 'c++programming' is smaller than 'javaprogramming'.
According to functionWithPointers: 'c++programming' is smaller than 'javaprogramming'.
Step by step
Solved in 2 steps with 1 images