I am recieiving this error:
C:/Mike/Uni/216/A2/code.c:221: warning: passing arg 2 of `CheckSum' from incompatible pointer type
C:/Mike/Uni/216/A2/code.c:226: warning: passing arg 2 of `digest' from incompatible pointer type
C:/Mike/Uni/216/A2/code.c:226: warning: passing arg 3 of `digest' from incompatible pointer type
Code:
int main()
{
char file[BLOCK];
unsigned char message[BLOCK];
unsigned char messageDigest[BUFFER];
int messageSize;
FILE* check; //file to check
scanf("%s",&file);
check = fopen(file,"r");
//checksum to make sure original
messageSize = CheckSum(check,message);
rewind(check);
//digest the stuff
digest(check,&messageDigest,&message,messageSize);
fclose(check);
return EXIT_SUCCESS;
}
//with these being the calls to
void digest(FILE *check,unsigned char *MessageDigest[], unsigned char *Message[],int newsize)
int CheckSum(FILE* check,unsigned char *Message[])
I've tried it several ways an can't find the way to pass a pointer ot the function
-&message
-&message[]
-message[]
-message
all similar errors, but we need a pointer to the array to alter the data currently there.
Same with an initialize option(I havent included yet)
We dont have the option of global variables.