Question: build a function in C++that can compare two parameters. This function should return a negative value (the value should be meaningful if possible: otherwise just

 build a function in C++that can compare two parameters. This function

build a function in C++that can compare two parameters. This function should return a negative value (the value should be meaningful if possible: otherwise just make sure it's negative) ifthe first parameter is smaller, 0 if they are equal, and a positive value if the first parameter is larger (the value should be meaningful if possible; otherwise make sure it's positive). This function should work with int, char, double, and string types Implement a function template to achieve the goal. After implemented the function template, test it with the following main function to make sure it will return the e int mainO ta; :eeu, return pos (prefer (prefer -32) 0.5)

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!