Note: .
As opposed to defining constants using define(), constants defined using the const keyword must be declared at the top-level scope because they are defined at compile-time. A named item that retains a … This means that they cannot be declared inside functions, loops, if statements or try/ catch blocks.
To declare a public module-level constant, precede the Const statement with the Public keyword.
Note: . Module-level constants are private by default. Pointers can be declared using const keyword too. After a constant is declared, it cannot be modified or assigned a new value. constant. - As opposed to defining constants using define(), constants defined using the const keyword must be declared at the top-level scope because they are defined at compile-time.
2) Pointers with const keyword in C++. You can declare a constant within a procedure or at the top of a module, in the Declarations section. When we use const with pointers, we can do it in two ways, either we can apply const to what the pointer is pointing to, or we can make the pointer itself a constant.. Pointer to a const variable. A Visual Basic identifier that is defined using the #Const compiler directive or defined in the host application and used by other compiler directives to determine when or if certain blocks of Visual Basic code are compiled.