CBSE Class 12 Computer Science Data File Handling In C++ Concepts

Read and download free pdf of CBSE Class 12 Computer Science Data File Handling In C++ Concepts. Get printable school Assignments for Class 12 Computer Science. Class 12 students should practise questions and answers given here for Data File Handling In C++ Concepts Computer Science in Class 12 which will help them to strengthen their understanding of all important topics. Students should also download free pdf of Printable Worksheets for Class 12 Computer Science prepared as per the latest books and syllabus issued by NCERT, CBSE, KVS and do problems daily to score better marks in tests and examinations

Assignment for Class 12 Computer Science Data File Handling In C++ Concepts

Class 12 Computer Science students should refer to the following printable assignment in Pdf for Data File Handling In C++ Concepts in Class 12. This test paper with questions and answers for Class 12 Computer Science will be very useful for exams and help you to score good marks

Data File Handling In C++ Concepts Class 12 Computer Science Assignment

 

DATA FILE HANDLING IN C++

File

A file is a stream of bytes stored on some secondary storage devices.

• Text file: A text file stores information in readable and printable form. Each line of text is terminated with an EOL (End of Line) character.

• Binary file: A binary file contains information in the non-readable form i.e. in the same format in which it is held in memory.

File Stream

• Stream: A stream is a general term used to name flow of data. Different streams are used to represent different kinds of data flow.

• There are three file I/O classes used for file read / write operations.

 ifstream - can be used for read operations.

 ofstream - can be used for write operations.

•  fstream - can be used for both read & write operations.


File modes:

• ios::out It open file in output mode (i.e write mode) and place the file pointer in beginning, if file already exist it will overwrite the file.

• ios::in It open file in input mode(read mode) and permit reading from the file.

• ios::app It open the file in write mode, and place file pointer at the end of file i.e to add new contents and retains previous contents. If file does not exist it will create a new file.

• ios::ate It open the file in write or read mode, and place file pointer at the end of file i.e input/ output operations can performed anywhere in the file.

• ios::trunc It truncates the existing file (empties the file).

• ios::nocreate If file does not exist this file mode ensures that no file is created and open() fails.

• ios::noreplace If file does not exist, a new file gets created but if the file already exists, the open() fails.

• ios::binary Opens a file in binary mode.

eof(): This function determines the end-of-file by returning true(non-zero) for end of file
otherwise returning false(zero).

close(): This function terminates the connection between the file and stream associated with it.

Stream_object.close(); e.g file.close();

Text File functions:

Char I/O :

· get() – read a single character from text file and store in a buffer.
e.g file.get(ch);

· put() - writing a single character in textfile e.g. file.put(ch);

· getline() - read a line of text from text file store in a buffer.
e.g file.getline(s,80);

· We can also use file>>ch for reading and file<<ch writing in text file. But >> operator
does not accept white spaces.

Binary file functions:

· read()- read a block of binary data or reads a fixed number of bytes from the specified

stream and store in a buffer.

Syntax : Stream_object.read((char *)& Object, sizeof(Object));
e.g file.read((char *)&s, sizeof(s));

· write() – write a block of binary data or writes fixed number of bytes from a specific
memory location to the specified stream.

Syntax : Stream_object.write((char *)& Object, sizeof(Object));
e.g file.write((char *)&s, sizeof(s));

Note:

Both functions take two arguments.

• The first is the address of variable, and the second is the length of that variable in bytes. The address of variable must be type cast to type char*(pointer to character type)

• The data written to a file using write( ) can only be read accurately using read( ).

Please refer to attached file for CBSE Class 12 Computer Science Data File Handling In C++ Concepts


More Study Material

CBSE Class 12 Computer Science Data File Handling In C++ Concepts Assignment

We hope you liked the above assignment for Data File Handling In C++ Concepts which has been designed as per the latest syllabus for Class 12 Computer Science released by CBSE. Students of Class 12 should download and practice the above Assignments for Class 12 Computer Science regularly. We have provided all types of questions like MCQs, short answer questions, objective questions and long answer questions in the Class 12 Computer Science practice sheet in Pdf. All questions have been designed for Computer Science by looking into the pattern of problems asked in previous year examinations. 

Assignment for Computer Science CBSE Class 12 Data File Handling In C++ Concepts

Our team of expert teachers have referred to NCERT book for Class 12 Computer Science to design the Computer Science Class 12 Assignments. If you practice at least one test paper daily, you will get higher marks in Class 12 exams this year. Daily practice of Computer Science course notes and related study material will help you to clear all your doubts and have stronger understanding of all concepts. You can download all Revision notes for Class 12 Computer Science also from www.studiestoday.com absolutely free of cost.

Data File Handling In C++ Concepts Assignment Computer Science CBSE Class 12

All questions and their answers for the assignment given above for Class 12 Computer Science have been developed as per the latest curriculum and books issued for the current academic year. The students of Class 12 can rest assured that the best teachers have designed the questions of Computer Science so that you are able to revise the entire syllabus if you do the assignments. Lot of MCQ questions for Class 12 Computer Science have also been given in the worksheets and assignments for regular use. All study material for Class 12 Computer Science students have been given on studiestoday.

Data File Handling In C++ Concepts Assignment CBSE Class 12 Computer Science

Regular assignment practice helps to get a more comprehensive understanding of Data File Handling In C++ Concepts concepts. Assignments play a crucial role in understanding Data File Handling In C++ Concepts in CBSE Class 12. Students can download all the assignments of the same chapter in Class 12 Computer Science in Pdf format. You can print them or read them online on your computer or mobile.

CBSE Computer Science Class 12 Data File Handling In C++ Concepts Assignment

CBSE Class 12 Computer Science latest books have been used for coming up with the latest questions and solutions for the above assignment. If you have revised all concepts relating to Data File Handling In C++ Concepts then you should attempt all questions given in the test sheets above. We have also provided lot of Worksheets for Class 12 Computer Science which you can use to further make your self stronger in Computer Science

Where can I download in PDF assignments for CBSE Class 12 Computer Science Data File Handling In C++ Concepts

You can download free Pdf assignments for CBSE Class 12 Computer Science Data File Handling In C++ Concepts from StudiesToday.com

The assignments for Data File Handling In C++ Concepts Class 12 Computer Science for have been made based on which syllabus

The Data File Handling In C++ Concepts Class 12 Computer Science Assignments have been designed based on latest CBSE syllabus for Class 12 Computer Science issued for the current academic year

Can I download and print these printable assignments for Computer Science Data File Handling In C++ Concepts Class 12

Yes, These printable assignments for Data File Handling In C++ Concepts Class 12 Computer Science are free to download and print

How many topics are covered in Data File Handling In C++ Concepts Computer Science assignments for Class 12

All topics given in Data File Handling In C++ Concepts Computer Science Class 12 Book for the current academic year have been covered in the given assignment

Is there any charge for this assignment for Data File Handling In C++ Concepts Computer Science Class 12

No, all Printable Assignments for Data File Handling In C++ Concepts Class 12 Computer Science have been given for free and can be downloaded in Pdf format

How can I download the printable test assignments for Data File Handling In C++ Concepts Computer Science Class 12

Just click on the View or Download button below, then another window with the Pdf will be visible, just click on the Pdf icon to download the free assignments for Data File Handling In C++ Concepts Class 12 Computer Science

Are these assignments available for all chapters in Class 12 Computer Science

Yes, apart from Computer Science you can download free assignments for all subjects in Class 12

Can I download solved assignments for Data File Handling In C++ Concepts CBSE Class 12 Computer Science

Our team of expert teachers at studiestoday.com have provided all answers for the practice questions which have been given in Class 12 Computer Science Data File Handling In C++ Concepts assignments