Back-End Programming Exam  >  Back-End Programming Videos  >  Learn to Program with C++: Beginner to Expert (in Hindi)  >  185. File Opening and Closing file using Open function in C++ (Hindi)

185. File Opening and Closing file using Open function in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

FAQs on 185. File Opening and Closing file using Open function in C++ (Hindi) Video Lecture - Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

1. फ़ाइल खोलना और बंद करना कैसे करते हैं?
उत्तर: फ़ाइल खोलने और बंद करने के लिए C में 'open' फ़ंक्शन का उपयोग किया जाता है। फ़ाइल खोलने के लिए आपको फ़ाइल का नाम और इसे खोलने के लिए चाहिए उदाहरण के लिए "r" (पढ़ने के लिए) या "w" (लिखने के लिए) जैसे मोड को संबोधित करना होगा। फ़ाइल बंद करने के लिए, आपको 'fclose' फ़ंक्शन का उपयोग करना होगा।
2. 'fopen' और 'open' में क्या अंतर है?
उत्तर: 'fopen' और 'open' दोनों फ़ंक्शन C में फ़ाइल खोलने के लिए उपयोग होते हैं, लेकिन उनका अंतर है। 'fopen' फ़ंक्शन सीधे FILE पॉइंटर को वापस देता है, जबकि 'open' फ़ंक्शन एक फ़ाइल डिस्क्रिप्टर वापस देता है। FILE पॉइंटर सभी C फ़ाइल ऑपरेशन के लिए उपयोग होता है, जबकि फ़ाइल डिस्क्रिप्टर केवल फ़ाइल खोलने और बंद करने के लिए उपयोग होता है।
3. क्या हम एक फ़ाइल को सिर्फ़ आगे से खोल सकते हैं?
उत्तर: जी हां, हम एक फ़ाइल को सिर्फ़ आगे से खोल सकते हैं। इसके लिए, आपको खोलने के लिए चाहिए मोड को "a" (जोड़ने के लिए) या "a+" (पढ़ने और जोड़ने के लिए) सेट करना होगा। इस मोड में, पहले से मौजूदा फ़ाइल के अंत में जोड़ा जाएगा।
4. फ़ाइल खोलते समय क्या होता है अगर फ़ाइल नहीं मिलती है?
उत्तर: अगर फ़ाइल नहीं मिलती है, तो 'open' फ़ंक्शन 'NULL' (शून्य) पॉइंटर वापस करेगा। इसे आपको सत्यापित करना चाहिए और उचित संबंधित संदेश दिखाना चाहिए।
5. एक फ़ाइल को कैसे बंद किया जाता है?
उत्तर: फ़ाइल को बंद करने के लिए 'fclose' फ़ंक्शन का उपयोग किया जाता है। यह फ़ंक्शन फ़ाइल पॉइंटर को बंद करने के बाद खाली कर देता है। इसे आपको फ़ाइल के अंत में आपसी संबंधित सभी संकेत और बंद करने की क्रियाएं संशोधित करने के बाद कॉल करना चाहिए।
Related Searches

Viva Questions

,

study material

,

past year papers

,

Exam

,

ppt

,

Previous Year Questions with Solutions

,

MCQs

,

Free

,

Sample Paper

,

Extra Questions

,

185. File Opening and Closing file using Open function in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

,

shortcuts and tricks

,

video lectures

,

pdf

,

185. File Opening and Closing file using Open function in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

,

185. File Opening and Closing file using Open function in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

,

practice quizzes

,

mock tests for examination

,

Summary

,

Semester Notes

,

Important questions

,

Objective type Questions

;