Pointer is a user authentic advice blazon which creates appropriate types of variables which can authority the abode of archaic advice blazon like char, int, float, bifold or user authentic advice blazon like function, arrow etc. or acquired advice blazon like array, structure, union, enum.
POINTER DECLARATION:
Declaring pointers can be actual ambagious & difficult sometimes (working with structures & arrow to pointers). To acknowledge arrow capricious they have to accomplish use of * abettor (indirection/dereferencing operator) before the capricious identifier & afterwards ability type. Arrow can alone point to capricious of the aforementioned ability type.
Syntax:
Datatype * identifier;
example:
int *a;
int (*ptr)();
FUNCTIONAL TERMS IN POINTERS:
1. ADDRESS OPERATOR
Address operator(&) is acclimated to get the abode of the operand. For archetype if capricious x is stored at area 100 of memory; &x will acknowledgment 100.
This abettor is acclimated to accredit amount to the arrow variable. It is important to accumulate in apperception that you MUST NOT use this abettor for arrays, no amount what ability blazon the arrangement is holding. This is because arrangement identifier (name) is arrow capricious itself. When they appeal ArrayA[2]; ArrayA allotment the abode of aboriginal account in that arrangement so ArrayA[2] is the aforementioned as adage ArrayA+=2; and will acknowledgment the third account in that array.
2. POINTER AIRTHMETIC
Pointers can airthmetic operations i.e. addition and subraction. However arrow addition is absolutely absurd unless performed on arrays. Addition and addition are mainly for affective advanced and astern in an array.
POINTER DECLARATION:
Declaring pointers can be actual ambagious & difficult sometimes (working with structures & arrow to pointers). To acknowledge arrow capricious they have to accomplish use of * abettor (indirection/dereferencing operator) before the capricious identifier & afterwards ability type. Arrow can alone point to capricious of the aforementioned ability type.
Syntax:
Datatype * identifier;
example:
int *a;
int (*ptr)();
FUNCTIONAL TERMS IN POINTERS:
1. ADDRESS OPERATOR
Address operator(&) is acclimated to get the abode of the operand. For archetype if capricious x is stored at area 100 of memory; &x will acknowledgment 100.
This abettor is acclimated to accredit amount to the arrow variable. It is important to accumulate in apperception that you MUST NOT use this abettor for arrays, no amount what ability blazon the arrangement is holding. This is because arrangement identifier (name) is arrow capricious itself. When they appeal ArrayA[2]; ArrayA allotment the abode of aboriginal account in that arrangement so ArrayA[2] is the aforementioned as adage ArrayA+=2; and will acknowledgment the third account in that array.
2. POINTER AIRTHMETIC
Pointers can airthmetic operations i.e. addition and subraction. However arrow addition is absolutely absurd unless performed on arrays. Addition and addition are mainly for affective advanced and astern in an array.
Sunday
//
Labels:
C LANGUAGE
//
0
comments
//
0 comments to "POINTERS IN C LANGUAGE"
Powered by Blogger.
Blog Archive
-
▼
2011
(50)
-
▼
July
(38)
- INTRODUCTION TO C
- DATA SETS IN C
- DATA TYPES
- VARIABLES
- SIMPLE C PROGRAM
- PROGRAM USING SCANF() AND PRINTF()
- C INSTRUCTIONS
- INTRODUCTION TO DECISION CONTROL STRUCTURES
- IF STATEMENT
- IF STATEMENT PROGRAM
- IF ELSE STATEMENT
- NESTED IF ELSE
- DETERMINING ROOTS OF AN EQUATION
- ELSE IF STATEMENT
- LOGICAL AND ARITHMETIC OPERATORS
- CONDITIONAL OPERATORS
- LOOPS
- THE WHILE LOOP
- The for bend specify things about a bend in a ind...
- EXAMPLE OF FOR LOOP
- NESTING OF LOOPS
- THE ODD LOOP
- THE DO-WHILE LOOP
- BREAK STATEMENT IN C
- THE CONTINUE STATEMENT IN C
- SWITCH STATEMENT IN C
- SIMPLE PROGRAM SHOWING SWITCH STATEMENT
- THE GOTO STATEMENT IN C LANGUAGE
- FUNCTIONS IN C LANGUAGE
- CALLING FUNCTIONS IN C LANGUAGE
- CALL BY REFERENCE IN C LANGUAGE
- POINTERS IN C LANGUAGE
- SIMPLE PROGRAM SHOWING POINTER IN C LANGUAGE
- PROGRAM FOR FUNCTION CALL BY REFERENCE IN C
- SWAPPING OF TWO NUMBERS IN C
- RECURSION IN C LANGUAGE
- FACTORIAL OF A NUMBER WITHOUT RECURSION IN C
- ARRAYS IN C LANGUAGE
-
▼
July
(38)
Post a Comment