C++ fstream help

Hello, I have been experimenting with ofsteam and ifsteam. This is an attempt to make a basic motel data base. It is giving me an error on the brackets of the first void function that is not the void prototypes

#include <iostream>
#include <stdlib.h>
#include <fstream>
#include <cstdio>

void RSer();
void Change();

int main()
{
    int choice;
    std::cout << "Welcome to Motel Data Base" << std::endl << std::endl << std::endl;
    std::cout << "1 = RoomsInfo" << std::endl;
    std::cout << "2 = Employes" << std::endl;
    std::cin >> choice;
    system("clear");
    switch (choice)
    {
         case '1':
             RSer();
             break;
         case '2':
             Change();
             break;
         std::cin.get();
    }
    void RSer()
    {
        ifstream Rserach("Info1.txt");
        std::string r;
        std::string s;

        std::cout << "Enter Room number: ";
        std::cin >> r;
        while(Rserach >> r)
        {
            if(s == r)
            {
                system("clear");
                std::cout << "Room found" << std::endl << std::endl;
                std::cout << "Occuped?" << Rstatus0 << std::endl;
                std::cout << "Cleanlness: " << Rstatus1 << std::endl;
            }
        }
        while (Rserach >> r)
        {
            if (s != r)
            {
                system ("clear");
                std::cout << "Room Does not exist" << std::endl;
            }
        }
        system ("pause");
        main();
        if(s != r)
        {
            std::cout << "Not found";
        }
        system("puase");
        main();
    }
    void Change()
    {
        std::string Rstatus0, Rstatus1;
        ofstream Info1("Info1.txt", ios::app);

        std::cout << "Enter Inhapitaze: ";
        std::cin >> Rstatus0;
        std::cout << "Enter Clenlness: ";
        std::cin >> Rstatus1;
        std::cin >> b4;

        Info1 << Rstatus0 << Rstatus1 << std::endl;
        Info1.close();
        main();
    }
    return 0;
}

I can’t really check it where I am right now, but on first glance, it looks like you have those functions being defined inside the main() ?

Try moving void RSer() and void Change() functions outside (before?) the main().

I thought that GCC compiler allows that me to define functions within the main but from looking into it further I realized that it did not.

I still have an error within the void though.

#include <iostream>
#include <stdlib.h>
#include <fstream>
#include <cstdio>

void RSer();
void Change();

void RSer()
{
    ifstream Rserach("Info1.txt");
    std::string r;
    std::string s;

    std::cout << "Enter Room number: ";
    std::cin >> r;
    while(Rserach >> r)
    {
        if(s == r)
        {
            system("clear");
            std::cout << "Room found" << std::endl << std::endl;
            std::cout << "Occuped?" << Rstatus0 << std::endl;
            std::cout << "Cleanlness: " << Rstatus1 << std::endl;
        }
        if (s != r)
        {
            system ("clear");
            std::cout << "Room Does not exist" << std::endl;
        }
    }
    system ("pause");
    main();
}
void Change()
{
    std::string Rstatus0, Rstatus1;
    ofstream Info1("Info1.txt", ios::app);

    std::cout << "Enter Inhapitaze: ";
    std::cin >> Rstatus0;
    std::cout << "Enter Clenlness: ";
    std::cin >> Rstatus1;
    std::cin >> b4;

    Info1 << Rstatus0 << Rstatus1 << std::endl;
    Info1.close();
    main();
}
int main()
{
    int choice;
    std::cout << "Welcome to Motel Data Base" << std::endl << std::endl << std::endl;
    std::cout << "1 = RoomsInfo" << std::endl;
    std::cout << "2 = Employes" << std::endl;
    std::cin >> choice;
    system("clear");
    switch (choice)
    {
    case '1':
        RSer();
        break;
    case '2':
        Change();
        break;
    std::cin.get();
    }
    return 0;
}