Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
4003CEM-Material/exam_practise/return.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
37 lines (29 sloc)
476 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copyright (C) 2023 Harry Clark - Student No. 12340530 */ | |
/* Date: 11/01/23 */ | |
#pragma once | |
#ifndef BOOL_RETURN | |
#define BOOL_RETURN | |
#include <iostream> | |
#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 |