|
This section contains 225 words (approx. 1 page at 300 words per page) |
Declarations are used in computer programming to introduce a new variable, or other new information for use. A variable is a symbol or a name that denotes a numerical value or characters. Typically declaration can be achieved using a declarative statement. The structure of the declarative statement varies from program to program. The intent of the statement, however, is the same across the various programming languages.
Declaration serves to tell the computer's compiler—a program that translates the source code into a code that will be used for the execution of actions--generalized aspects of the piece of information, such as an identifying name, type, and the amount of memory that needs to be allocated. The compiler is thus able to allocate enough memory to hold a value of that particular data type and to associate an identifier with the location.
Data that is created must be declared before it can be used. Declaration can be made at the time the data is used. Thus, declarations are an essential part of programming languages. The language used to declare variables differs in different operating programs. For example, in the C programming language, the declaration "int" is used to express integers and the declaration "float" is used to express real numbers. In both Java and Pascal, each variable declaration is denoted by the code "var."
|
This section contains 225 words (approx. 1 page at 300 words per page) |
