Revision history for KeyPgConstQualifier


Revision [20857]

Last edited on 2016-03-12 15:58:04 by fxm [Formatting]
Additions:







Revision [20102]

Edited on 2016-02-10 15:55:59 by DkLwikki [Update link format]
Additions:
... [[KeyPgAs|as]] [**Const**] //[[DataType|datatype]]// [ [**Const**] [[KeyPgPtr|ptr]] ... ]
Specifies that the ##//datatype//## or ##[[KeyPgPtr|ptr]]## immediately to the right of the ##**Const**## qualifier is to be considered as read only. Read-only (##**Const**##) declarations are a measure of type safety that can be read as 'promises not to change.' The compiler uses the const declarations to check operations on variables and parameters and generate an error at compile time if their data could potentially change. There is no runtime overhead for using ##**Const**## qualifiers since all of the checks are made at compile time.
With pointer declarations, ##**Const**## can be used to indicate which part of the pointer declaration is read-only (all other parts are by default read-write). The read-only portion of the pointer data type could be the pointer itself (the address), what the pointer points to (the data), or both. In a declaration with more than one level of ##[[KeyPgPtr|Ptr]]## indirection, the right most ##[[KeyPgPtr|Ptr]]## indicates the highest order level of indirection and is therefore dereferenced first.
The compiler has an internal hard-limit of eight (8) levels of pointer indirection with respect to const qualifiers and the behavior of using ##**Const**## with ##[[KeyPgPtr|Ptr]]## data types having greater than eight (8) levels of indirection is undefined.
- ##[[KeyPgConst|Const]]##
- ##[[KeyPgConstMember|Const (Member)]]##
- ##[[KeyPgDim|Dim]]##
- ##[[KeyPgType|Type]]##
Deletions:
... [[KeyPgAs as]] [**Const**] //[[DataType datatype]]// [ [**Const**] [[KeyPgPtr ptr]] ... ]
Specifies that the ##//datatype//## or ##[[KeyPgPtr ptr]]## immediately to the right of the ##**Const**## qualifier is to be considered as read only. Read-only (##**Const**##) declarations are a measure of type safety that can be read as 'promises not to change.' The compiler uses the const declarations to check operations on variables and parameters and generate an error at compile time if their data could potentially change. There is no runtime overhead for using ##**Const**## qualifiers since all of the checks are made at compile time.
With pointer declarations, ##**Const**## can be used to indicate which part of the pointer declaration is read-only (all other parts are by default read-write). The read-only portion of the pointer data type could be the pointer itself (the address), what the pointer points to (the data), or both. In a declaration with more than one level of ##[[KeyPgPtr Ptr]]## indirection, the right most ##[[KeyPgPtr Ptr]]## indicates the highest order level of indirection and is therefore dereferenced first.
The compiler has an internal hard-limit of eight (8) levels of pointer indirection with respect to const qualifiers and the behavior of using ##**Const**## with ##[[KeyPgPtr Ptr]]## data types having greater than eight (8) levels of indirection is undefined.
- ##[[KeyPgConst Const]]##
- ##[[KeyPgConstMember Const (Member)]]##
- ##[[KeyPgDim Dim]]##
- ##[[KeyPgType Type]]##


Revision [14280]

Edited on 2009-08-29 21:51:58 by CountingPine [Remove CamelCase links in "New to FreeBASIC"]
Additions:
- New to ""FreeBASIC""
Deletions:
- New to FreeBASIC


Revision [12570]

The oldest known version of this page was created on 2008-02-14 14:24:10 by JeffMarshall [Remove CamelCase links in "New to FreeBASIC"]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode