Wong said:
static const char assertFileName[] = __FILE__;
Assert();
This is normally found in applications, what does this mean ?
static - if global, variable visible in this file only.
- if in a function, hold in permanent storage (do not destroy when
function returns).
const - the variable is read-only.
char - the variable is of character type.
assertFileName - call the variable "assertFileName"
[] - it is an array of unspecified size (big enough to hold initialiser).
= - initialise it.
__FILE__ - a special symbol which the compiler expands to the name of the
current file.
; - C statement terminator.
Assert().
Look up the stdlib function "assert()". Often you will find that in real
code people do not use the assert() provided, but a similar function with a
similar name. Capitalising the first letter is a common way of doing this.