Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I guarantee one #define is larger than another?

#define MY_CONST 20
#define OTHER_CONST 10

My code only makes sense if MY_CONST > OTHER_CONST. How can I guarantee this with the preprocessor? Is there any command like this?

#assert MY_CONST < OTHER_CONST
like image 466
Anna Avatar asked Jun 15 '18 13:06

Anna


People also ask

How do you guarantee someone?

How does a person become a guarantor: a person can become a guarantor when, first, they are asked by someone who is borrowing money if they would help get the loan by agreeing to be a guarantor for them and, second, they sign a written and legally binding agreement, called a guarantee, with the bank or micro-credit ...

Who is a guaranteed for person?

At law, the giver of a guarantee is called the surety or the "guarantor". The person to whom the guarantee is given is the creditor or the "obligee"; while the person whose payment or performance is secured thereby is termed "the obligor", "the principal debtor", or simply "the principal".

Who can be a guarantor?

Almost anyone can be a guarantor. It's often a parent or spouse (as long as you have separate bank accounts), but sometimes a friend or relative. However, you should only be a guarantor for someone you trust and are willing and able to cover the repayments for.


1 Answers

Is there any command like this?

#assert MY_CONST < OTHER_CONST

#if OTHER_CONST >= MY_CONST
#error "Error, OTHER_CONST >= MY_CONST"
#endif
like image 152
Attersson Avatar answered Nov 23 '22 23:11

Attersson