I hereby claim:
- I am talbenari1 on github.
- I am talbenari1 (https://keybase.io/talbenari1) on keybase.
- I have a public key whose fingerprint is C82F 3773 E0CF BFD3 5B6F 799D 5F4F CF8C 5AD0 4FAB
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
For all of these programs, never use using namespace std;
. Declare each function explicitly as necessary.
Write a function named insertionSort
that takes a pointer to an integer and an integer as arguments. The function should sort the array passed to it using the insertion sort algorithm and print out each step of the process. Demonstrate the function in a program. Do the same for selection sort, or any other sorting algorithm that interests you.
Write a function template named sum
that takes two different types as arguments. The function returns the sum of the two values passed to it, using the type given by the first value. Demonstrate the template in a program with combinations of int
and double
.
Write two functions that each take a pointer to an integer, an integer, and a string as arguments. One function, arrayToFile
, should push the contents of the given array to the given filename. The other function, fileToArray
, pushes the contents of the file to the array. Demo
# The compiler to use. g++ should work as well. | |
CC = clang++ | |
# CC = g++ | |
# The flags to set during compilation. | |
CFLAGS = -g -O2 -Wall -MMD -MP --std=c++11 -fdiagnostics-color=always | |
# My prefix | |
NAME := BenAriTal |