Back-End Programming Exam  >  Back-End Programming Videos  >  Learn to Program with C++: Beginner to Expert (in Hindi)  >  186. Example of opening file using open function in C++ (Hindi)

186. Example of opening file using open function in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

FAQs on 186. Example of opening 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 function का उपयोग करके फ़ाइल को कैसे खोलें?"
उत्तर: फ़ाइल को खोलने के लिए, हम open() फ़ंक्शन का उपयोग कर सकते हैं। सामान्यतः यह फ़ंक्शन दो तत्वों को लेती है - फ़ाइल नाम और खोलने के लिए फ़ाइल तरीका (जैसे कि रीड या व्राइट)। एक फ़ाइल खोलने के बाद, हम उसे पढ़ने या लिखने के लिए उपयोग कर सकते हैं।
2. "C में open function का उपयोग करके फ़ाइल को बंद कैसे करें?"
उत्तर: फ़ाइल को बंद करने के लिए, हम close() फ़ंक्शन का उपयोग कर सकते हैं। इस फ़ंक्शन को फ़ाइल कोड के साथ बुलाना होता है जिसे हम बंद करना चाहते हैं। फ़ाइल बंद करने के बाद, हम उसे और नहीं पढ़ या लिख सकते हैं।
3. "open function में उपयोग होने वाले फ़ाइल तरीकों में कौन-कौन से हो सकते हैं?"
उत्तर: open() फ़ंक्शन में उपयोग होने वाले कुछ फ़ाइल तरीके निम्नलिखित हैं: 1. "r" - फ़ाइल को पढ़ने के लिए खोलने के लिए। 2. "w" - फ़ाइल को लिखने के लिए खोलने के लिए। अगर फ़ाइल मौजूद नहीं है, तो नई फ़ाइल बनाई जाएगी। 3. "a" - फ़ाइल को लिखने के लिए खोलने के लिए। यह फ़ाइल मौजूद होने की स्थिति में फ़ाइल के अंत में जोड़ेगा। 4. "rb" या "wb" - बाइनरी मोड में फ़ाइल को पढ़ने या लिखने के लिए खोलने के लिए। 5. "a+" - फ़ाइल को पढ़ने और लिखने के लिए खोलने के लिए। यह फ़ाइल मौजूद होने की स्थिति में फ़ाइल के अंत में जोड़ेगा।
4. "क्या open function फ़ाइल को बना सकती है अगर वह मौजूद नहीं है?"
उत्तर: हाँ, open() फ़ंक्शन फ़ाइल को बना सकती है अगर वह मौजूद नहीं है। जब हम "w" या "a" तरीके का उपयोग करते हैं, और फ़ाइल मौजूद नहीं होती है, तो एक नई फ़ाइल बनाई जाती है।
5. "C में फ़ाइल को कैसे पढ़ा जाता है जब वह खोली गई हो?"
उत्तर: फ़ाइल को पढ़ने के लिए, हम fread() फ़ंक्शन का उपयोग कर सकते हैं। इस फ़ंक्शन में हम फ़ाइल कोड, पठनीय वस्तु की आकार, पठनीय वस्तु की संख्या, और पठनीय वस्तु की जगह प्रदान करते हैं। यह फ़ंक्शन फ़ाइल से डेटा पढ़कर उसे वस्तुओं में भरता है और हमें पढ़ने की आवश्यकता के अनुसार उसे उपयोग कर सकते हैं।
Related Searches

Semester Notes

,

video lectures

,

186. Example of opening file using open function in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

,

Previous Year Questions with Solutions

,

MCQs

,

Summary

,

past year papers

,

Free

,

Exam

,

Viva Questions

,

pdf

,

Important questions

,

Objective type Questions

,

186. Example of opening file using open function in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

,

Sample Paper

,

Extra Questions

,

shortcuts and tricks

,

ppt

,

study material

,

practice quizzes

,

mock tests for examination

,

186. Example of opening file using open function in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

;