Hi!

I was wondering if someone might have an example of this that I might could take a look at, would really appreciate it since we have a test in about a week.

Thanks in advance!

Adam

Recommended Answers

All 2 Replies

Hi!

I was wondering if someone might have an example of this that I might could take a look at, would really appreciate it since we have a test in about a week.

Thanks in advance!

Adam

Hello

I think that noone will give you the source, because this is just like a homework :)

Anyway the theorie is simple. You open the first file for read. Then open the second file for write(create and write).
With While:
you read a line(string) from first file, run on it the for (i to line.length() ) and uppercase/lowercase each char. When the "for" finnished you write the line(string) to the second file.
And repeat this till you are at the end of first file (nothing can be read). Then close it.


Shorter in steps:
-ask for filename for both files
-open both files (first = read, second=write)

-while ( not end of first file){
-read a line from first file
-upper/lower case all chars with for
-write the line to second file
}
-close both files
.

there is a function tolower that you can use to help you with this.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.