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

186 videos

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' फ़ंक्शन का उपयोग किया जाता है। यह फ़ंक्शन फ़ाइल पॉइंटर को बंद करने के बाद खाली कर देता है। इसे आपको फ़ाइल के अंत में आपसी संबंधित सभी संकेत और बंद करने की क्रियाएं संशोधित करने के बाद कॉल करना चाहिए।

Up next

Explore Courses for Back-End Programming exam
Related Searches

practice quizzes

,

shortcuts and tricks

,

past year papers

,

Exam

,

pdf

,

Important questions

,

study material

,

mock tests for examination

,

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

,

Free

,

Previous Year Questions with Solutions

,

ppt

,

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

,

MCQs

,

Viva Questions

,

video lectures

,

Sample Paper

,

Extra Questions

,

Objective type 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

,

Semester Notes

,

Summary

;