This is what I have so far

My function does not work and my compiler says my int array is not initialized

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

using namespace std;

void arrayToFile(ofstream tak, int *arr[], int size )

for (int i = 0; i<size; i++)
tak.write(&arr[i], sizeof(arr[i]));

//void fileToArray(FILE got, int *arr[], int size1);

int main()
int slen;
slen = 2;
int joly[slen] = { 1,2,3,4,5 };
ofstream outfile;"data.bin",ios:ut | ios::binary);
arrayToFile(outfile, *joly, slen);

return 0;