I came across this example of an assertion and was wondering what the #
is for:
#define ASSERT( x ) if ( !( x ) ) { \
int *p = NULL; \
DBGPRINTF("Assert failed: [%s]\r\n Halting.", #x); \
*p=1; \
}
The definite article (the) is used before a noun to indicate that the identity of the noun is known to the reader. The indefinite article (a, an) is used before a noun that is general or when its identity is not known. There are certain situations in which a noun takes no article.
The word the is considered a definite article because it defines the meaning of a noun as one particular thing. It's an article that gives a noun a definite meaning: a definite article. Generally, definite articles are used to identify nouns that the audience already knows about.
The is used to describe a specific noun, whereas a/an is used to describe a more general noun. For this reason, the is also referred to as a definite article, and a/an is referred to as an indefinite article. The definite article, the, is used before both singular and plural nouns when the noun is specific.
The word the is very important to native speakers of English because it is used to divide the world we process through language into two categories: old information and new information. It helps us to divide the world into things which we agree are known, or important, and things which we feel aren't.
It is the "stringize" preprocessing operator.
It takes the tokens passed as the argument to the macro parameter x
and turns them into a string literal.
#define ASSERT(x) #x
ASSERT(a b c d)
// is replaced by
"a b c d"
#x
is the stringification directive
#define Stringify(x) #x
means Stringify(abc)
will be substituted with "abc"
as in
#define initVarWithItsOwnName(x) const char* p = #x
int main()
{
initVarWithItsOwnName(Var);
std::cout << Var; //will print Var
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With