Join our WhatsApp Channel Join Now!

डेटा प्रकार (प्रिमिटिव, नॉन-प्रिमिटिव) हिंदी

इस ब्लॉग में, C++ में डेटा प्रकार क्या है, इसके प्रकार, उदाहरण और उपयोग के बारे में जानेंगे। डेटा प्रकार प्रिमिटिव और नॉन-प्रिमिटिव दोनों होते हैं।

डेटा टाइप्स वह होते हैं जो एक प्रोग्राम में उपयोग किए जाने वाले डेटा के प्रकार को निर्धारित करते हैं। वे यह बताते हैं कि डेटा कितनी मेमोरी लेगा, कौन से ऑपरेशंस कर सकते हैं और कैसे स्टोर होगा। डेटा टाइप्स को दो श्रेणियों में बांटा जा सकता है: प्रिमिटिव और नॉन-प्रिमिटिव

Image
Data types (Primitive, Non Primitive) in Hindi 

प्रिमिटिव डेटा टाइप्स:

ये वे डेटा टाइप्स होते हैं जो प्रोग्रामिंग भाषा द्वारा पहले से ही परिभाषित होते हैं। ये एक सिंगल वैल्यू को स्टोर करते हैं। ये बेसिक बिल्डिंग ब्लॉक्स होते हैं जिनका उपयोग अन्य डेटा टाइप्स बनाने के लिए किया जा सकता है। उदाहरण के लिए, इन्टेजर, फ्लोट, चार, बूलियन, इत्यादि।


```cpp

int x = 10; // इन्टेजर डेटा टाइप

float y = 3.14; // फ्लोट डेटा टाइप

char z = 'A'; // चार डेटा टाइप

bool w = true; // बूलियन डेटा टाइप

```

नॉन-प्रिमिटिव डेटा टाइप्स: 

ये वे डेटा टाइप्स होते हैं जो प्रोग्रामर द्वारा बनाए जाते हैं या प्रोग्रामिंग भाषा द्वारा प्रदान किए जाते हैं। ये एक से अधिक वैल्यू को स्टोर करते हैं। ये अधिक जटिल और विविध होते हैं। उदाहरण के लिए, ऐरे, स्ट्रिंग, स्ट्रक्चर, यूनियन, क्लास, ऑब्जेक्ट, इत्यादि।

C++

int arr[5] = {1, 2, 3, 4, 5}; // ऐरे डेटा टाइप

string s = "Hello"; // स्ट्रिंग डेटा टाइप

struct Point { // स्ट्रक्चर डेटा टाइप

  int x;

  int y;

};

Point p = {10, 20}; // स्ट्रक्चर ऑब्जेक्ट

class Circle { // क्लास डेटा टाइप

  private:

    double radius;

  public:

    void set_radius (double r) {

      radius = r;

    }

    double get_radius () {

      return radius;

    }

    double compute_area () {

      return 3.14*radius*radius;

    }

};

Circle c; // क्लास ऑब्जेक्ट

c.set_radius (5.5);


इस ब्लॉग में हमने डेटा टाइप्स (प्रिमिटिव, नॉन-प्रिमिटिव) के बारे में जाना। आशा है कि आपको यह उपयोगी लगा होगा। अगर आपको इस विषय पर और जानकारी चाहिए तो आप निम्नलिखित लिंक्स का उपयोग कर सकते हैं:


- [Data types in C++ (हिन्दी)]

- [Primitive data types (हिंदी)]

- [Non-primitive data types(हिंदी)]


धन्यवाद! 🙏

About the Author

Hi, I'm Vivek Kumar, a web developer focused on creating clean, efficient, and user-friendly websites. Let's build something amazing together!

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.