Skip to content

Instantly share code, notes, and snippets.

@iarash84
Created March 7, 2023 07:30
Show Gist options
  • Save iarash84/12207048791b0d9871d99d962dea0204 to your computer and use it in GitHub Desktop.
Save iarash84/12207048791b0d9871d99d962dea0204 to your computer and use it in GitHub Desktop.
simple template usage
int intArr[] = { 5, 8, 2, 1, 9 };
double doubleArr[] = { 1.2, 5.5, 2.7, 8.1 };
std::cout << "Max int value: " << findMax(intArr, 5) << std::endl;
// Output: "Max int value: 9"
std::cout << "Max double value: " << findMax(doubleArr, 4) << std::endl;
// Output: "Max double value: 8.1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment