I am currently making an encryption/decryption program. After encryption, the result is stored in a text file, with each character stored as a hex value. I am currently working on the decryption, and the first stage is to read in that file, and store each hex value as an element in an array.
FILE * decryptIn = fopen("output.txt", "r");
fseek(decryptIn, 0L, SEEK_END); //counts the amount of bytes from start to end of file
int fileSize = ftell(decryptIn); //stores the size of the file in bytes
rewind(decryptIn); //sets offset back to 0 (back to start of file)
int *decryptHexArray = malloc(sizeof(int)*5*fileSize);
int currentPointer;
int counter = 0;
while(fgets(decryptHexArray[counter], fileSize, decryptIn)) //loop that reads each string from the file
{
counter++;
}
The error message I am getting is
passing argument 1 of 'fgets' makes pointer from integer without a cast
Is it possible to achieve what i want with fgets?