Reference variables

Reference variable behave similar to both, a value variable and a pointer variable. Value variable are used to hold some numeric values, pointer variable are used to hold the address of some other variable. In programme code reference variable is used similar to that of a value variable but has an action of a pointer variable." Reference variable benefits from the simplicity of the value variable and power of pointer variable". It does provide the flexibility supported by the pointer variable, unlike pointer when a reference is bound to a variable, then its binding cannot be changed. All the accesses made to the reference variable as same as to the access to which it is bound. The general format of declaring reference variable is:

 

Data type and reference variable + value variable

Where data type can be standard or user defined type:

Like Int, char, float etc.

& reference operator

The reference variable must be initialized to same variable only at the point of its declaration. Initialization of reference variable following its declaration sources compilation error.

 




 

   Related Questions in Programming Languages

  • Q : Application of S60 device The

    The application has been earlier tested along with an S60 2nd Edition device and this is Symbian Signed. So can I install similar application to another S60 device?

  • Q : Component which are used in 2nd layer

    What are the different types of component parts which are used in 2nd layer?

  • Q : Importance of client-side libraries

    Explain the importance of the client-side libraries?

  • Q : Explain Cast Cast : Where Java does not

    Cast: Where Java does not allow the utilization of a source value of one type, it is essential to use a cast to force the compiler to admit the use for the target type. The care must be taken with casting values of primitive types, as this frequently

  • Q : Explain the term QTP Environment

    Explain the term QTP Environment?

  • Q : Define the term Inheritance Inheritance

    Inheritance: It is a feature of object-oriented programming languages in which a sub-type inherits methods and variables from its super-type. The Inheritance is most generally employed as a synonym for class inheritance {class!inheritance}, however in

  • Q : Problem on Gaussian Matlab function

    Solve the system Ax = b, with using the given Matlab function gauss (it cal

  • Q : What is an Operand Operand : An operand

    Operand: An operand is an argument of the operator. Expressions comprise combinations of operands and operators. The value of an expression is determined by exerting the operation stated by each and every operator to the value of its operands.

  • Q : Define Peer Peer : It is a term

    Peer: It is a term employed of the Abstract Windowing Toolkit (AWT) to refer to the underlying classes which give the platform-specific implementation of the component classes.

  • Q : Describe Method result Method result :

    Method result: The value returned from a method through a return statement. The kind of expression in the return statement should match the return type declared in method header.

©TutorsGlobe All rights reserved 2022-2023.