uni

University stuff
git clone git://git.christosmarg.xyz/uni-assignments.git
Log | Files | Refs | README | LICENSE

commit 86f854ad46bf6c51f9a5b9969c921e45aeaa637a
parent aeb0b8ea3fb7d0df0b59403bccd19ade7cbb4705
Author: Christos Margiolis <christos@margiolis.net>
Date:   Wed,  8 Jan 2020 22:17:15 +0200

edited .h

Diffstat:
Massignment-1.5-arrays-pointers-files/combinations/include/combinations.h | 24+++++++++++-------------
Massignment-1.5-arrays-pointers-files/combinations/src/combinations.c | 8+-------
Massignment-1.5-arrays-pointers-files/combinations/src/main.c | 4++--
3 files changed, 14 insertions(+), 22 deletions(-)

diff --git a/assignment-1.5-arrays-pointers-files/combinations/include/combinations.h b/assignment-1.5-arrays-pointers-files/combinations/include/combinations.h @@ -3,27 +3,25 @@ #include <stdbool.h> -int get_n(const char *); +int get_val(const char *); +int *fill_array(int); +bool exists_in_array(int *, int, int); + +void x_pair(int *, int *); +void y_pair(int *, int *); + +void combinations(int *); +int even_calc(); +int sum_calc(); +void print_combs(); int combinations_count(int); int factorial(int); -int sum_calc(); int sum_comb_calc(); -int even_calc(); int not_printed(); - -int *fill_array(int); - float frequency(); char *get_filename(); - -bool exists_in_array(int *, int, int); bool is_subset(); - -void x_pair(int *, int *); -void y_pair(int *, int *); -void combinations(int *); -void print_combs(); void read_file(); #endif diff --git a/assignment-1.5-arrays-pointers-files/combinations/src/combinations.c b/assignment-1.5-arrays-pointers-files/combinations/src/combinations.c @@ -6,7 +6,7 @@ #define COMBSN 6 -int get_n(const char *varName) +int get_val(const char *varName) { int num; @@ -120,12 +120,6 @@ void combinations(int *arr) } -int find_even() -{ - -} - - int even_calc() { diff --git a/assignment-1.5-arrays-pointers-files/combinations/src/main.c b/assignment-1.5-arrays-pointers-files/combinations/src/main.c @@ -9,8 +9,8 @@ int main(int argc, char **argv) int *arr; int x1, x2, y1, y2; - N = get_n("N"); - K = get_n("K"); + N = get_val("N"); + K = get_val("K"); arr = fill_array(N); x_pair(&x1, &x2); y_pair(&y1, &y2);