Slide1 l.jpg
This presentation is the property of its rightful owner.
Sponsored Links
1 / 19

apples peaches pears PowerPoint PPT Presentation


bananas apples peaches pears OLDVERSION.TXT apples peaches pears plums raspberries strawberries tangerines NEWVERSION.TXT apples bananas peaches pears plums strawberries tangerines How to modify a file. You can't! Method 1: Copy and modify. Method 2:

Download Presentation

apples peaches pears

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Slide1 l.jpg

bananas

apples

peaches

pears


Slide2 l.jpg

OLDVERSION.TXT

apples

peaches

pears

plums

raspberries

strawberries

tangerines

NEWVERSION.TXT

apples

bananas

peaches

pears

plums

strawberries

tangerines

How to modify a file.

You can't!

Method 1:

Copy and modify.


Slide3 l.jpg

Method 2:

Copy input file to an array.

theFile.TXT

char data[100][80]

apples

peaches

pears

plums

raspberries

strawberries

tangerines

[0] apples

[1] peaches

[2] pears

[3] plums

[4] raspberries

[5] strawberries

[6] tangerines


Slide4 l.jpg

Close the input file.

char data[100][80]

data[0]

data[1]

data[2]

data[3]

data[4]

data[5]

data[6]

data[7]

data[8]

[0] apples

[1] peaches

[2] pears

[3] plums

[4] rasberries

[5] strawberries

[6] tangerines

apples

peaches

pears

plums

raspberries

strawberries

tangerines


Slide5 l.jpg

Modify the array.

char data[100][80]

data[0]

data[1]

data[2]

data[3]

data[4]

data[5]

data[6]

data[7]

data[8]

apples

peaches

pears

plums

raspberries

strawberries

tangerines


Slide6 l.jpg

Modify the array.

Add bananas

char data[100][80]

data[0]

data[1]

data[2]

data[3]

data[4]

data[5]

data[6]

data[7]

data[8]

apples

peaches

pears

plums

raspberries

strawberries

tangerines


Slide7 l.jpg

Modify the array.

Add bananas

char data[100][80]

data[0]

data[1]

data[2]

data[3]

data[4]

data[5]

data[6]

data[7]

data[8]

apples

peaches

pears

plums

raspberries

strawberries

tangerines

tangerines


Slide8 l.jpg

Modify the array.

Add bananas

char data[100][80]

data[0]

data[1]

data[2]

data[3]

data[4]

data[5]

data[6]

data[7]

data[8]

apples

peaches

pears

plums

raspberries

strawberries

strawberries

tangerines


Slide9 l.jpg

Modify the array.

Add bananas

char data[100][80]

data[0]

data[1]

data[2]

data[3]

data[4]

data[5]

data[6]

data[7]

data[8]

apples

peaches

pears

plums

rasberries

raspberries

strawberries

tangerines


Slide10 l.jpg

Modify the array.

Add bananas

char data[100][80]

data[0]

data[1]

data[2]

data[3]

data[4]

data[5]

data[6]

data[7]

data[8]

apples

peaches

pears

plums

plums

raspberries

strawberries

tangerines


Slide11 l.jpg

Modify the array.

Add bananas

char data[100][80]

data[0]

data[1]

data[2]

data[3]

data[4]

data[5]

data[6]

data[7]

data[8]

apples

peaches

pears

pears

plums

raspberries

strawberries

tangerines


Slide12 l.jpg

Modify the array.

Add bananas

char data[100][80]

data[0]

data[1]

data[2]

data[3]

data[4]

data[5]

data[6]

data[7]

data[8]

apples

peaches

peaches

pears

plums

raspberries

strawberries

tangerines


Slide13 l.jpg

Modify the array.

Add bananas

char data[100][80]

data[0]

data[1]

data[2]

data[3]

data[4]

data[5]

data[6]

data[7]

data[8]

apples

bananas

peaches

pears

plums

raspberries

strawberries

tangerines


Slide14 l.jpg

Modify the array.

Remove raspberries

char data[100][80]

data[0]

data[1]

data[2]

data[3]

data[4]

data[5]

data[6]

data[7]

data[8]

apples

bananas

peaches

pears

plums

raspberries

strawberries

tangerines


Slide15 l.jpg

Modify the array.

Remove raspberries

char data[100][80]

data[0]

data[1]

data[2]

data[3]

data[4]

data[5]

data[6]

data[7]

data[8]

apples

bananas

peaches

pears

plums

strawberries

strawberries

tangerines


Slide16 l.jpg

Modify the array.

Remove raspberries

char data[100][80]

data[0]

data[1]

data[2]

data[3]

data[4]

data[5]

data[6]

data[7]

data[8]

apples

bananas

peaches

pears

plums

strawberries

tangerines

tangerines


Slide17 l.jpg

Modify the array.

char data[100][80]

data[0]

data[1]

data[2]

data[3]

data[4]

data[5]

data[6]

data[7]

data[8]

apples

bananas

peaches

pears

plums

strawberries

tangerines

tangerines


Slide18 l.jpg

Open the file for output.

char data[100][80]

theFile.TXT

data[0]

data[1]

data[2]

data[3]

data[4]

data[5]

data[6]

data[7]

data[8]

apples

bananas

peaches

pears

plums

strawberries

tangerines

tangerines


Slide19 l.jpg

Copy array to file.

char data[100][80]

theFile.TXT

data[0]

data[1]

data[2]

data[3]

data[4]

data[5]

data[6]

data[7]

data[8]

apples

bananas

peaches

pears

plums

strawberries

tangerines

tangerines

apples

bananas

peaches

pears

plums

strawberries

tangerines


  • Login