Pointer in C language

Pointer is a special type of variable present in 'C' language, which stores memory address of a variable as its value. Pointer must occupy two bytes in computer memory. Pointer stores unsigned integer value only, which are accessed by %u formatted string. Updation (increment/ decrement) of pointer is according to its datatype.
เคธी เคฒैंเค—्เคตेเคœ เคฎें เคชॉเค‡ंเคŸเคฐ เคเค• เคตिเคถेเคท เคช्เคฐเค•ाเคฐ เค•ा เคตेเคฐिเคเคฌเคฒ เคนोเคคा เคนै เคœो เค‰เคธी เคช्เคฐเค•ाเคฐ เค•े เค•िเคธी เคฆुเคธเคฐे เคตेเคฐिเคเคฌเคฒ เค•ा เคฎेเคฎोเคฐी เคเคก्เคฐेเคธ (เคตैเคฒ्เคฏू เค•े เคฐूเคช เคฎें) เคฐเค–เคคा เคนै। เคชॉเค‡ंเคŸเคฐ เคธเคฆैเคต เคฎेเคฎोเคฐी เคฎें เคฆो เคฌाเค‡เคŸ เค—्เคฐเคนเคฃ เค•เคฐเคคे เคนै। เคชॉเค‡ंเคŸเคฐ เค•ेเคตเคฒ เค…เคจเคธाเค‡ंเคก เค‡เคจ्เคŸिเคœเคฐ เคตैเคฒ्เคฏू เคธ्เคŸोเคฐ เค•เคฐเคคे เคนै เคœिเคธे %u เคซॉเคฐเคฎेเคŸेเคก เคธ्เคŸ्เคฐींเค— เคธे เคเค•्เคธेเคธ เค•िเคฏा เคœाเคคा เคนै। เคชॉเค‡ंเคŸเคฐ เค•ा เค…เคชเคกेเคถเคจ เค‰เคธเค•े เคกाเคŸा เคŸाเค‡เคช เค•े เค…เคจुเคธाเคฐ เคนोเคคा เคนै      

Declaration of pointer:- 
Syntax:- 
data _ type * pointer _ name;

Example:- 
char *p; 
int *link;
float *ptr; 
double *a;

Initialization of pointer:- 
Providing initial value to a pointer variable at the time of its declaration is called initialization of pointer.
เคชॉเค‡ंเคŸเคฐ เค•ो เคช्เคฐाเคฐंเคญिเค• เคฎाเคจ เคช्เคฐเคฆाเคจ เค•เคฐเคจा เค‡เคจिเคถिเคฏเคฒाเค‡เคœेเคถเคจ เค•เคนเคฒाเคคा เคนै 
Syntax:- 
datatype *pointer _ name= &variable _ name;

Example:- 1. float *ptr=&a;
2. float *ptr, x=10, y=25;
ptr=&x;
printf ("x=%f",*ptr);
ptr=&y;
printf ("y=%f",*ptr);

Advantages of pointer:- 
1.) Use of pointers increases speed of execution of a C program.
2.) Pointer can able to access user defined data types like array, union, string, structure, function, file etc with normal data type as well.
3.) Function uses pointer in call by reference method.
4.) User can perform dynamic memory allocation through pointers.
5.) Pointer can able to change value of actual argument passed to a function.

เคชॉเค‡ंเคŸเคฐ เค•े เคฒाเคญ-
1.) เคชॉเค‡ंเคŸเคฐ เค•े เคช्เคฐเคฏोเค— เคธे เคธी เคช्เคฐोเค—्เคฐाเคฎ เค•ा เคเค•्เคธीเค•्เคฏूเคถเคจ เคคीเคต्เคฐ เคนोเคคा เคนै
2.) เคชॉเค‡ंเคŸเคฐ เค•े เคฆ्เคตाเคฐा เคธाเคฎाเคจ्เคฏ เคกाเคŸा เคŸाเค‡เคช เค•े เคธाเคฅ เคธाเคฅ เคฏूเคœเคฐ เคกिเคซाเค‡ंเคก เคกाเคŸा เคŸाเค‡เคช เคœैเคธे เค…เคฐे,เคธ्เคŸ्เคฐींเค—,เคธ्เคŸ्เคฐเค•्เคšเคฐ,เคฏूเคจिเคฏเคจ เค‡เคค्เคฏाเคฆि เค•ो เคญी เคเค•्เคธेเคธ เค•िเคฏा เคœा เคธเค•เคคा เคนै
3.) เคซंเค•्เคถเคจ เค•ी เค•ॉเคฒ เคฌाเคฏ เคฐिเคซเคฐेเคจ्เคธ เคฎेเคฅเคก เคฎें เคชॉเค‡ंเคŸเคฐ เค•ा เคช्เคฐเคฏोเค— เค•िเคฏा เคœाเคคा เคนै 
4.) เคชॉเค‡ंเคŸเคฐ เค•े เคฆ्เคตाเคฐा เคฏूเคœเคฐ เคกाเคฏเคจाเคฎिเค• เคฎेเคฎोเคฐी เคเคฒोเค•ेเคถเคจ เค•เคฐ เคธเค•เคคा เคนै
5.) เคชॉเค‡ंเคŸเคฐ เค•े เคฆ्เคตाเคฐा เคซंเค•्เคถเคจ เค•े เคเค•्เคšुเค…เคฒ เค†เคฐ्เค—ुเคฎेंเคŸ เค•ी เคตैเคฒ्เคฏू เค•ो เคชเคฐिเคตเคฐ्เคคिเคค เค•िเคฏा เคœा เคธเค•เคคा เคนै 

Disadvantages of pointer:- 
1.) If pointer variable will update with incorrect memory address, then it will affect other programs.
2.) It is a responsibility of a programmer to free allocated blocks after program execution through pointer, if it was not done then computer system faces memory overflow.

เคชॉเค‡ंเคŸเคฐ เค•ी เคนाเคจिเคฏाँ -
1.) เคฏเคฆि เคชॉเค‡ंเคŸเคฐ เค•ो เค—เคฒเคค เคฎेเคฎोเคฐी เคเคก्เคฐेเคธ เค•े เคธाเคฅ เค…เคชเคกेเคŸ เค•िเคฏा เคœाเคคा เคนै เคคเคฌ เคฏเคน เค…เคจ्เคฏ เคช्เคฐोเค—्เคฐाเคฎ เค•ो เคนाเคจी เคชंเคนुเคšा เคธเค•เคคा เคนै 
2.) เคฏเคน เคช्เคฐोเค—्เคฐाเคฎเคฐ เค•ी เคœिเคฎ्เคฎेเคฆाเคฐी เคนै เค•ि เคตเคน เคชॉเค‡ंเคŸเคฐ เคฆ्เคตाเคฐा เคช्เคฐเคฆเคค्เคค เคฎेเคฎोเคฐी เค•ो เค•ाเคฎ เคนो เคœाเคจे เค•े เคชเคถ्เคšाเคค เคซ्เคฐी เค•เคฐे เค…เคจ्เคฏเคฅा เค“เคตเคฐเคซ्เคฒो เค•ंเคกीเคถเคจ เค‰เคค्เคชเคจ्เคจ เคนो เคธเค•เคคी เคนै

Comments

Popular posts from this blog

C Language Topics in Hindi and English

C language IMP Questions for BSc/BA/BCom/BCA/BE/BTech/MSc/MCA (CS/IT) I year students