diff --git a/exam_practise/char.h b/exam_practise/char.h new file mode 100644 index 0000000..8a58474 --- /dev/null +++ b/exam_practise/char.h @@ -0,0 +1,11 @@ +/* Copyright (C) 2023 Harry Clark - Student No. 12340530 */ +/* Date: 11/01/23 */ + +#pragma once + +#ifndef CHAR +#define CHAR + +char myVariable = '@'; + +#endif \ No newline at end of file diff --git a/exam_practise/return.h b/exam_practise/return.h new file mode 100644 index 0000000..40d39e4 --- /dev/null +++ b/exam_practise/return.h @@ -0,0 +1,37 @@ +/* Copyright (C) 2023 Harry Clark - Student No. 12340530 */ +/* Date: 11/01/23 */ + +#pragma once + +#ifndef BOOL_RETURN +#define BOOL_RETURN + +#include + +#define TENARY_VER +bool is_answer(int value) +{ + return value == 42 ? true : false; +} + +#define IF_ELSE_VER +bool is_answer(int value) +{ + if (value == 42) + { + return true; + } + + else + { + return false; + } +} + +#define SIMPLIFIED +bool is_answer(int value) +{ + return value == 42; +} + +#endif \ No newline at end of file