Struct function expected a ‘;’ [duplicate]

  c++

Well, I created this struct data but I want to make a function for reading the struct data from the files.The compiler tells me that I forgot a ‘;’ right at the 3rd { line.

#include <iostream>
#include <fstream>
#include <string.h>

using namespace std;
ifstream f("value.in");
int main()
{
    struct Auxiliary
        {
          char come_greet[100], leave_greet[100], aux_words[100];  
        };
        Auxiliary j[1000];
    
    void readStructAuxiliary( struct x y[],int x, char *name)
        {
            ifstream fin("auxfile.in");
            for(int i = 1;i<=x;i++)
                    fin>>y.name;
        }
}

Source: Windows Questions C++

LEAVE A COMMENT