#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
if (argc!=2)
{
fprintf(stderr, "./recover nameofimagefile\n");
return 1;
}
char *rawfile = argv[1];
FILE *inptr = fopen(rawfile, "r");
if (inptr == NULL)
{
fprintf(stderr, "Could not open %s.\n", rawfile);
return 2;
}
typedef unsigned char BYTE;
BYTE buffer[512];
int p=0;
char *newfile = malloc(sizeof(buffer)*p);
int filecounter=0;
FILE *outptr = fopen(newfile, "w");
if (outptr == NULL)
{
fprintf(stderr, "Could not open for writing.\n");
return 3;
}
I dont understand why it keeps returning 3 to me, how do i stop this problem