Posts

Showing posts with the label Triple Pointer

Pointer Arithmetic पॉइंटर अरिथमेटिक

We can perform arithmetic operations on pointers, such as increment (++) and decrement (--), which update the value of a pointer variable according to the data type to which it points. This is known as pointer arithmetic. हम पॉइंटर पर इन्क्रीमेंट (++) एवं डीक्रीमेंट (--) जैसे अरिथमेटिक ऑपरेशन लागू कर सकते हैं, जो पॉइंटर वेरिएबल की वैल्यू को उसके द्वारा पॉइंट किए जाने वाले डाटा टाइप के अनुसार अपडेट करते हैं। इसे पॉइंटर अरिथमेटिक (Pointer Arithmetic) कहा जाता है। In the following example, there are three pointers that point to character, integer, and float type arrays, respectively. निम्न उदाहरण में तीन पॉइंटर वेरिएबल हैं, जो क्रमशः करैक्टर, इन्टिजर एवं फ्लोट डाटा टाइप के ऐरे को पॉइंट करते हैं। char name[10], *p; int x[10], *q; float per[5], *r; p = name; q = x; r = per; p++; q++; r++; q++; p++; --r; r++; q++; p--; In the above example: Pointer p increases or decreases by 1 byte. Pointer q increases or decreases by 2 bytes. Pointer r increases or decreases by 4 bytes. उपरोक्त उदाहरण म...

Pointer to Pointer पॉइंटर टू पॉइंटर, pointer of pointer पॉइंटर ऑफ़ पॉइंटर

A pointer variable which stores the memory address of another pointer variable is called a pointer to pointer. एक पॉइंटर वेरिएबल जो किसी अन्य पॉइंटर वेरिएबल का मेमोरी एड्रेस स्टोर करता है, पॉइंटर टू पॉइंटर (Pointer to Pointer) कहलाता है। Syntax: data_type *pointer_name; data_type **pointer_to_pointer_name; data_type ***pointer_to_pointer_to_pointer_name; Example: int *p, **q, ***r; In the above example: p is a pointer variable which stores the address of an integer variable. q is a pointer to pointer variable which stores the address of pointer p . r is a pointer to pointer to pointer variable which stores the address of pointer q . उपरोक्त उदाहरण में: p एक पॉइंटर वेरिएबल है जो किसी इन्टिजर वेरिएबल का मेमोरी एड्रेस स्टोर करता है। q एक पॉइंटर टू पॉइंटर वेरिएबल है जो पॉइंटर p का मेमोरी एड्रेस स्टोर करता है। r एक पॉइंटर टू पॉइंटर टू पॉइंटर वेरिएबल है जो पॉइंटर q का मेमोरी एड्रेस स्टोर करता है। C Program for Pointer to Pointer #include <stdio.h> #include <conio.h> void ...