Exercise 5. 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++Programming Enter Second String:             JavaProgramming According to functionWithArrays: 'c++programming' is smaller than 'javaprogramming'. According to functionWithPointers: 'c++programming' is smaller than 'javaprogramming'.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter10: Pointers
Section: Chapter Questions
Problem 3PP
icon
Related questions
Question

Exercise 5. 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++Programming
Enter Second String:             JavaProgramming
According to functionWithArrays: 'c++programming' is smaller than 'javaprogramming'.
According to functionWithPointers: 'c++programming' is smaller than 'javaprogramming'.

Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning