I would like to make a program that reads a specific file, shows it to the user and then makes every letter in that file big (like k->K) using to_upper and shows it to the user again. I don't know what is wrong with my code but it shows some errors.
    using namespace std;
    void to save(){
        fstream plik;
        string napis;
        char z;
        plik.open("name_of_the_file.txt", ios::out | ios::in);
            if(plik.good()){
            cout << "File before using to upper: " << endl;
                while(!plik.eof()) {
                plik >> napis;
                cout << napis << endl;
                }
            cout << "File after using to upper: " << endl;
                while(!plik.eof(z)) {
                    plik.put(toupper(z));
                }
                }
                plik.close();
                }
int main(){
    save();
return (0);
}
I know which libraries should I use I just don't know how to post them here.
 
     
    