From e2996cecf37c56c08413254a54ad043ab1cda1d1 Mon Sep 17 00:00:00 2001 From: Krishna Vedala <7001608+kvedala@users.noreply.github.com> Date: Fri, 12 Jun 2020 12:45:07 -0400 Subject: [PATCH] replace `free` with `delete` operator --- sorting/shell_sort2.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sorting/shell_sort2.cpp b/sorting/shell_sort2.cpp index 6d9230ed1..5db773aca 100644 --- a/sorting/shell_sort2.cpp +++ b/sorting/shell_sort2.cpp @@ -134,8 +134,8 @@ void test_int(const int NUM_DATA) { // the standard results } - free(data); - free(data2); + delete[] data; + delete[] data2; } /** @@ -175,8 +175,8 @@ void test_f(const int NUM_DATA) { // the standard results } - free(data); - free(data2); + delete[] data; + delete[] data2; } /** Main function */ @@ -229,6 +229,6 @@ int main(int argc, char *argv[]) { double elapsed_time = (end - start) * 1.f / CLOCKS_PER_SEC; std::cout << "Time spent sorting: " << elapsed_time << "s\n" << std::endl; - free(data); + delete[] data; return 0; }