Hey guys I have to functions that I am opening files with and I seem to be doing it wrong.
The first function contains a null terminated string that contains the name of the file.
The second function receives a pointer to the file. I just put the file name because I wasn't sure the correct way to open it with the pointer.
Does anyone know how i can fix these two problems?
Code:
#include <cstring>
#include <cstdio>
FILE* open(const char filename[])
{
FILE fp;
if(fp!=Null)
{
fp=fopen("filename","r");//doesnt work
}
else
{
fp=NULL;
}
return fp;
}
int registeredA(FILE* fp, int area)
{
fp=fopen("prefix.txt","r"); //I know this is wrong this the file I want to open but dont know how with this function
}