Bananas
Download
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:

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha

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


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:

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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


ad
  • Login