Back-End Programming Exam  >  Back-End Programming Videos  >  Learn to Program with C++: Beginner to Expert (in Hindi)  >  181. fstream header file and its classes in C++ (Hindi)

181. fstream header file and its classes in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

186 videos

FAQs on 181. fstream header file and its classes in C++ (Hindi) Video Lecture - Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

1. fstream हेडर फ़ाइल क्या है और इसमें कौन-कौन से क्लासेस होते हैं?
उत्तर: fstream हेडर फ़ाइल C++ में एक प्रीडिफ़ाइंड हेडर फ़ाइल है जो इनपुट और आउटपुट स्ट्रीम्स के लिए तार क्लासेस प्रदान करती है। इस हेडर फ़ाइल में निम्नलिखित तीन क्लासेस होते हैं: - ifstream: यह क्लास इनपुट स्ट्रीम के लिए होता है और इनपुट ऑपरेशन्स को संचालित करने के लिए उपयोग किया जाता है। - ofstream: यह क्लास आउटपुट स्ट्रीम के लिए होता है और आउटपुट ऑपरेशन्स को संचालित करने के लिए उपयोग किया जाता है। - fstream: यह क्लास इनपुट और आउटपुट स्ट्रीम्स के लिए होता है और इनपुट और आउटपुट ऑपरेशन्स को संचालित करने के लिए उपयोग किया जाता है।
2. fstream क्लास के आदेश और उपयोग का तरीका क्या है?
उत्तर: fstream क्लास का आदेश निम्नलिखित है: 1. fstream लाइब्रेरी को इंक्लूड करें: `#include <fstream>`. 2. fstream ऑब्जेक्ट बनाएं: `fstream file;`. 3. फ़ाइल खोलें: `file.open("filename.txt", mode);` (यहां "filename.txt" आपके फ़ाइल का नाम होना चाहिए और "mode" आपके इनपुट या आउटपुट के लिए होना चाहिए). 4. फ़ाइल में डेटा लिखें या पढ़ें: `file << data;` (लिखने के लिए) और `file >> data;` (पढ़ने के लिए). 5. फ़ाइल बंद करें: `file.close();`.
3. fstream क्लास का उपयोग करके फ़ाइल में डेटा कैसे लिखा जाता है?
उत्तर: fstream क्लास का उपयोग करके फ़ाइल में डेटा लिखने के लिए निम्नलिखित कदमों का पालन करें: 1. fstream ऑब्जेक्ट बनाएं और फ़ाइल खोलें: `fstream file; file.open("filename.txt", ios::out);` (यहां "filename.txt" आपके फ़ाइल का नाम होना चाहिए). 2. डेटा को फ़ाइल में लिखें: `file << data;` (यहां "data" आपके लिखने के लिए डेटा होना चाहिए). 3. फ़ाइल बंद करें: `file.close();`.
4. fstream क्लास का उपयोग करके फ़ाइल से डेटा कैसे पढ़ा जाता है?
उत्तर: fstream क्लास का उपयोग करके फ़ाइल से डेटा पढ़ने के लिए निम्नलिखित कदमों का पालन करें: 1. fstream ऑब्जेक्ट बनाएं और फ़ाइल खोलें: `fstream file; file.open("filename.txt", ios::in);` (यहां "filename.txt" आपके फ़ाइल का नाम होना चाहिए). 2. डेटा को फ़ाइल से पढ़ें: `file >> data;` (यहां "data" आपके पढ़ने के लिए डेटा होना चाहिए). 3. फ़ाइल बंद करें: `file.close();`.
5. fstream क्लास का उपयोग करके एक फ़ाइल को कैसे बनाएं और उसे लिखें?
उत्तर: fstream क्लास का उपयोग करके एक फ़ाइल बनाने और उसे लिखने के लिए निम्नलिखित कदमों का पालन करें: 1. fstream ऑब्जेक्ट बनाएं और फ़ाइल खोलें: `fstream file; file.open("filename.txt", ios::out);` (यहां "filename.txt" आपके फ़ाइल का नाम होना चाहिए). 2. डेटा को फ़ाइल में लिखें: `file << data;` (यहां "data" आपके लिखने के लिए डेटा होना चाहिए). 3. फ़ाइल बंद करें: `file.close();`.
186 videos
Explore Courses for Back-End Programming exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

ppt

,

Viva Questions

,

181. fstream header file and its classes in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

,

Important questions

,

Sample Paper

,

181. fstream header file and its classes in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

,

Extra Questions

,

Previous Year Questions with Solutions

,

Semester Notes

,

181. fstream header file and its classes in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

,

Summary

,

Free

,

pdf

,

study material

,

past year papers

,

MCQs

,

practice quizzes

,

Exam

,

video lectures

,

shortcuts and tricks

,

mock tests for examination

,

Objective type Questions

;