- Constants are also the name given to the data values stored in memory like variable but the value of constant cannot be changed during script.
- Unlike the variable constant’s name does not start with $ sign. A constant name starts with a letter or underscore.
- Constant’s scope is global across the entire script.
- To create a constant in PHP we have to use the define() function.
- Here is the syntax of define() function:
- Here name specifies the name of the constant.
- value specifies the value of the constant.
- case-insensitive specifies whether the constant name should be case-insensitive or not. Its default value is false.
Here is an example of PHP-constant:
- The above example prints the value of constant “Number” that is 60.
- Given example shows the case-insensitivity of constant:
define(“Number”, “60”, true);
- The above example also prints the value of constant “Number” that is 60.
c language features
- Simple and Easy to learn.
- Powerful and Efficient.
application of c language
C language is used to develop a simple program and as well as complex Application and System software also. Some of the applications of C language are given below:
- Operating system
- Modern Programs
- Compiler, Assembler and Interpreter
- Network Drivers
- Text Editors and Print Spoolers.
Overview of Compiler and Interpreters
Before talking about the Compiler and Interpreter we have to know some important points as given below:
- A program is a set of instructions used to perform a particular task.
- These programs are written in assembly language or high level language (English words),this written program is called as source program which cannot be understood by the computer. Computer can only understand the instructions available in the form of machine language as ‘0’ and ‘1’.
- The source program is to be converted to the machine language that is known as object program.
- Source program is converted into object program with the help of interpreter or compiler which are explained here in detail:
- Compiler reads the entire source program and converts it into the object program.
- Compiler provides errors of entire program at once instead of providing them line by line. Only error free program can be executed.
- Compiler consumes less time for converting source program to object program.
- Compiler is preferred where length of the source program is very large.
- Interpreter reads only one line of source program at a time and converts it into the object code.
- Interpreter provides error line by line.
- Interpreter consumes more time for converting source program to object program than compiler.