I defined a struct contains variables and an array and after that defined a function with the return type of that struct in the .cpp file and everything worked good.