SlideShare une entreprise Scribd logo
1  sur  13
Lecture 22Lecture 22
Version 1.0Version 1.0
More on FilesMore on Files
2Rushdi Shams, Dept of CSE, KUET, Bangladesh
A File Copy ProgramA File Copy Program
 We will take a look at how you read from a fileWe will take a look at how you read from a file
 And then how you can put the content of thatAnd then how you can put the content of that
file into another filefile into another file
3Rushdi Shams, Dept of CSE, KUET, Bangladesh
4Rushdi Shams, Dept of CSE, KUET, Bangladesh
File Opening ModesFile Opening Modes
 Read (r)Read (r)
Searches the fileSearches the file
If the search is successfulIf the search is successful
load the file into memoryload the file into memory
set a pointer at the beginning of the fileset a pointer at the beginning of the file
If the file cannot be openedIf the file cannot be opened
returns NULLreturns NULL
Only reads from fileOnly reads from file
5Rushdi Shams, Dept of CSE, KUET, Bangladesh
File Opening ModesFile Opening Modes
 Write (w)Write (w)
Searches the fileSearches the file
If the file existsIf the file exists
it is overwrittenit is overwritten
If notIf not
a new file is createda new file is created
If the file cannot be openedIf the file cannot be opened
returns NULLreturns NULL
Only writes to fileOnly writes to file
6Rushdi Shams, Dept of CSE, KUET, Bangladesh
File Opening ModesFile Opening Modes
 Append (a)Append (a)
Searches the fileSearches the file
If the search is successfulIf the search is successful
load the file into memoryload the file into memory
set a pointer at the end of the fileset a pointer at the end of the file
If the file cannot be openedIf the file cannot be opened
returns NULLreturns NULL
Adding new contents in the fileAdding new contents in the file
7Rushdi Shams, Dept of CSE, KUET, Bangladesh
File Opening ModesFile Opening Modes
 Append Plus (a+)Append Plus (a+)
Searches the fileSearches the file
If the search is successfulIf the search is successful
load the file into memoryload the file into memory
If not foundIf not found
create a new filecreate a new file
If the file cannot be openedIf the file cannot be opened
returns NULLreturns NULL
Reading, appending in fileReading, appending in file
Cannot modifyCannot modify
8Rushdi Shams, Dept of CSE, KUET, Bangladesh
File Opening ModesFile Opening Modes
 Read Plus (r+)Read Plus (r+)
Searches the fileSearches the file
If the search is successfulIf the search is successful
load the file into memoryload the file into memory
set a pointer at first characterset a pointer at first character
If the file cannot be openedIf the file cannot be opened
returns NULLreturns NULL
Reading, writing, modifying contents in the fileReading, writing, modifying contents in the file
9Rushdi Shams, Dept of CSE, KUET, Bangladesh
File Opening ModesFile Opening Modes
 Write Plus (w+)Write Plus (w+)
Searches the fileSearches the file
If the file existsIf the file exists
it is overwrittenit is overwritten
If notIf not
a new file is createda new file is created
If the file cannot be openedIf the file cannot be opened
returns NULLreturns NULL
Writing, reading and modifying contentsWriting, reading and modifying contents
10Rushdi Shams, Dept of CSE, KUET, Bangladesh
String in FilesString in Files
 So far we have seen how to manipulateSo far we have seen how to manipulate
characters in filescharacters in files
 Now, we will see that handling strings in files isNow, we will see that handling strings in files is
as easy as handling charactersas easy as handling characters
 At first we will see how to write strings into aAt first we will see how to write strings into a
filefile
11Rushdi Shams, Dept of CSE, KUET, Bangladesh
12Rushdi Shams, Dept of CSE, KUET, Bangladesh
 Now we will see how to read strings from filesNow we will see how to read strings from files
13Rushdi Shams, Dept of CSE, KUET, Bangladesh

Contenu connexe

Similaire à File Copy Program Lecture - Read, Write Strings Files

File handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reuge
File handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reugeFile handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reuge
File handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reugevsol7206
 
Python files / directories part15
Python files / directories  part15Python files / directories  part15
Python files / directories part15Vishal Dutt
 
File handling4.pdf
File handling4.pdfFile handling4.pdf
File handling4.pdfsulekha24
 
Python Files I_O17.pdf
Python Files I_O17.pdfPython Files I_O17.pdf
Python Files I_O17.pdfRashmiAngane1
 
File Handling Python
File Handling PythonFile Handling Python
File Handling PythonAkhil Kaushik
 
File handing in C
File handing in CFile handing in C
File handing in Cshrishcg
 
File handling and Dictionaries in python
File handling and Dictionaries in pythonFile handling and Dictionaries in python
File handling and Dictionaries in pythonnitamhaske
 
what are python basics.pptx.Join Python training in Chandigarh
what are python basics.pptx.Join Python training in Chandigarhwhat are python basics.pptx.Join Python training in Chandigarh
what are python basics.pptx.Join Python training in Chandigarhasmeerana605
 
File handling in C hhsjsjshsjjsjsjs.pptx
File handling in C hhsjsjshsjjsjsjs.pptxFile handling in C hhsjsjshsjjsjsjs.pptx
File handling in C hhsjsjshsjjsjsjs.pptxarmaansohail9356
 

Similaire à File Copy Program Lecture - Read, Write Strings Files (20)

File handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reuge
File handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reugeFile handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reuge
File handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reuge
 
pspp-rsk.pptx
pspp-rsk.pptxpspp-rsk.pptx
pspp-rsk.pptx
 
Unit-VI.pptx
Unit-VI.pptxUnit-VI.pptx
Unit-VI.pptx
 
Filesin c++
Filesin c++Filesin c++
Filesin c++
 
Python files / directories part15
Python files / directories  part15Python files / directories  part15
Python files / directories part15
 
File handling4.pdf
File handling4.pdfFile handling4.pdf
File handling4.pdf
 
FILES IN C
FILES IN CFILES IN C
FILES IN C
 
Python Files I_O17.pdf
Python Files I_O17.pdfPython Files I_O17.pdf
Python Files I_O17.pdf
 
File Handling Python
File Handling PythonFile Handling Python
File Handling Python
 
File Handling in C
File Handling in CFile Handling in C
File Handling in C
 
File accessing modes in c
File accessing modes in cFile accessing modes in c
File accessing modes in c
 
File handling3.pdf
File handling3.pdfFile handling3.pdf
File handling3.pdf
 
File handling in c
File handling in cFile handling in c
File handling in c
 
File handling
File handlingFile handling
File handling
 
File handing in C
File handing in CFile handing in C
File handing in C
 
File handling and Dictionaries in python
File handling and Dictionaries in pythonFile handling and Dictionaries in python
File handling and Dictionaries in python
 
what are python basics.pptx.Join Python training in Chandigarh
what are python basics.pptx.Join Python training in Chandigarhwhat are python basics.pptx.Join Python training in Chandigarh
what are python basics.pptx.Join Python training in Chandigarh
 
Python-FileHandling.pptx
Python-FileHandling.pptxPython-FileHandling.pptx
Python-FileHandling.pptx
 
Com ed 5 final
Com ed 5 finalCom ed 5 final
Com ed 5 final
 
File handling in C hhsjsjshsjjsjsjs.pptx
File handling in C hhsjsjshsjjsjsjs.pptxFile handling in C hhsjsjshsjjsjsjs.pptx
File handling in C hhsjsjshsjjsjsjs.pptx
 

Plus de Rushdi Shams

Research Methodology and Tips on Better Research
Research Methodology and Tips on Better ResearchResearch Methodology and Tips on Better Research
Research Methodology and Tips on Better ResearchRushdi Shams
 
Common evaluation measures in NLP and IR
Common evaluation measures in NLP and IRCommon evaluation measures in NLP and IR
Common evaluation measures in NLP and IRRushdi Shams
 
Machine learning with nlp 101
Machine learning with nlp 101Machine learning with nlp 101
Machine learning with nlp 101Rushdi Shams
 
Semi-supervised classification for natural language processing
Semi-supervised classification for natural language processingSemi-supervised classification for natural language processing
Semi-supervised classification for natural language processingRushdi Shams
 
Natural Language Processing: Parsing
Natural Language Processing: ParsingNatural Language Processing: Parsing
Natural Language Processing: ParsingRushdi Shams
 
Types of machine translation
Types of machine translationTypes of machine translation
Types of machine translationRushdi Shams
 
L1 l2 l3 introduction to machine translation
L1 l2 l3  introduction to machine translationL1 l2 l3  introduction to machine translation
L1 l2 l3 introduction to machine translationRushdi Shams
 
Syntax and semantics
Syntax and semanticsSyntax and semantics
Syntax and semanticsRushdi Shams
 
Propositional logic
Propositional logicPropositional logic
Propositional logicRushdi Shams
 
Probabilistic logic
Probabilistic logicProbabilistic logic
Probabilistic logicRushdi Shams
 
Knowledge structure
Knowledge structureKnowledge structure
Knowledge structureRushdi Shams
 
Knowledge representation
Knowledge representationKnowledge representation
Knowledge representationRushdi Shams
 
L5 understanding hacking
L5  understanding hackingL5  understanding hacking
L5 understanding hackingRushdi Shams
 
L2 Intrusion Detection System (IDS)
L2  Intrusion Detection System (IDS)L2  Intrusion Detection System (IDS)
L2 Intrusion Detection System (IDS)Rushdi Shams
 

Plus de Rushdi Shams (20)

Research Methodology and Tips on Better Research
Research Methodology and Tips on Better ResearchResearch Methodology and Tips on Better Research
Research Methodology and Tips on Better Research
 
Common evaluation measures in NLP and IR
Common evaluation measures in NLP and IRCommon evaluation measures in NLP and IR
Common evaluation measures in NLP and IR
 
Machine learning with nlp 101
Machine learning with nlp 101Machine learning with nlp 101
Machine learning with nlp 101
 
Semi-supervised classification for natural language processing
Semi-supervised classification for natural language processingSemi-supervised classification for natural language processing
Semi-supervised classification for natural language processing
 
Natural Language Processing: Parsing
Natural Language Processing: ParsingNatural Language Processing: Parsing
Natural Language Processing: Parsing
 
Types of machine translation
Types of machine translationTypes of machine translation
Types of machine translation
 
L1 l2 l3 introduction to machine translation
L1 l2 l3  introduction to machine translationL1 l2 l3  introduction to machine translation
L1 l2 l3 introduction to machine translation
 
Syntax and semantics
Syntax and semanticsSyntax and semantics
Syntax and semantics
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 
Probabilistic logic
Probabilistic logicProbabilistic logic
Probabilistic logic
 
L15 fuzzy logic
L15  fuzzy logicL15  fuzzy logic
L15 fuzzy logic
 
Knowledge structure
Knowledge structureKnowledge structure
Knowledge structure
 
Knowledge representation
Knowledge representationKnowledge representation
Knowledge representation
 
First order logic
First order logicFirst order logic
First order logic
 
Belief function
Belief functionBelief function
Belief function
 
L5 understanding hacking
L5  understanding hackingL5  understanding hacking
L5 understanding hacking
 
L4 vpn
L4  vpnL4  vpn
L4 vpn
 
L3 defense
L3  defenseL3  defense
L3 defense
 
L2 Intrusion Detection System (IDS)
L2  Intrusion Detection System (IDS)L2  Intrusion Detection System (IDS)
L2 Intrusion Detection System (IDS)
 
L1 phishing
L1  phishingL1  phishing
L1 phishing
 

Dernier

Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 

Dernier (20)

Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 

File Copy Program Lecture - Read, Write Strings Files

  • 1. Lecture 22Lecture 22 Version 1.0Version 1.0 More on FilesMore on Files
  • 2. 2Rushdi Shams, Dept of CSE, KUET, Bangladesh A File Copy ProgramA File Copy Program  We will take a look at how you read from a fileWe will take a look at how you read from a file  And then how you can put the content of thatAnd then how you can put the content of that file into another filefile into another file
  • 3. 3Rushdi Shams, Dept of CSE, KUET, Bangladesh
  • 4. 4Rushdi Shams, Dept of CSE, KUET, Bangladesh File Opening ModesFile Opening Modes  Read (r)Read (r) Searches the fileSearches the file If the search is successfulIf the search is successful load the file into memoryload the file into memory set a pointer at the beginning of the fileset a pointer at the beginning of the file If the file cannot be openedIf the file cannot be opened returns NULLreturns NULL Only reads from fileOnly reads from file
  • 5. 5Rushdi Shams, Dept of CSE, KUET, Bangladesh File Opening ModesFile Opening Modes  Write (w)Write (w) Searches the fileSearches the file If the file existsIf the file exists it is overwrittenit is overwritten If notIf not a new file is createda new file is created If the file cannot be openedIf the file cannot be opened returns NULLreturns NULL Only writes to fileOnly writes to file
  • 6. 6Rushdi Shams, Dept of CSE, KUET, Bangladesh File Opening ModesFile Opening Modes  Append (a)Append (a) Searches the fileSearches the file If the search is successfulIf the search is successful load the file into memoryload the file into memory set a pointer at the end of the fileset a pointer at the end of the file If the file cannot be openedIf the file cannot be opened returns NULLreturns NULL Adding new contents in the fileAdding new contents in the file
  • 7. 7Rushdi Shams, Dept of CSE, KUET, Bangladesh File Opening ModesFile Opening Modes  Append Plus (a+)Append Plus (a+) Searches the fileSearches the file If the search is successfulIf the search is successful load the file into memoryload the file into memory If not foundIf not found create a new filecreate a new file If the file cannot be openedIf the file cannot be opened returns NULLreturns NULL Reading, appending in fileReading, appending in file Cannot modifyCannot modify
  • 8. 8Rushdi Shams, Dept of CSE, KUET, Bangladesh File Opening ModesFile Opening Modes  Read Plus (r+)Read Plus (r+) Searches the fileSearches the file If the search is successfulIf the search is successful load the file into memoryload the file into memory set a pointer at first characterset a pointer at first character If the file cannot be openedIf the file cannot be opened returns NULLreturns NULL Reading, writing, modifying contents in the fileReading, writing, modifying contents in the file
  • 9. 9Rushdi Shams, Dept of CSE, KUET, Bangladesh File Opening ModesFile Opening Modes  Write Plus (w+)Write Plus (w+) Searches the fileSearches the file If the file existsIf the file exists it is overwrittenit is overwritten If notIf not a new file is createda new file is created If the file cannot be openedIf the file cannot be opened returns NULLreturns NULL Writing, reading and modifying contentsWriting, reading and modifying contents
  • 10. 10Rushdi Shams, Dept of CSE, KUET, Bangladesh String in FilesString in Files  So far we have seen how to manipulateSo far we have seen how to manipulate characters in filescharacters in files  Now, we will see that handling strings in files isNow, we will see that handling strings in files is as easy as handling charactersas easy as handling characters  At first we will see how to write strings into aAt first we will see how to write strings into a filefile
  • 11. 11Rushdi Shams, Dept of CSE, KUET, Bangladesh
  • 12. 12Rushdi Shams, Dept of CSE, KUET, Bangladesh  Now we will see how to read strings from filesNow we will see how to read strings from files
  • 13. 13Rushdi Shams, Dept of CSE, KUET, Bangladesh