Possible Duplicate:
void pointer as argument
I'm trying to make a simple function in C, but I get an empty output and I can't figure out why:
int encrypt(unsigned char *message, char *key, unsigned char *buffered_message)
{
/* ... */
buffered_message = calloc(1, (blocks * block_size));
/* ... */
printf("Message: %s\n", buffered_message);
return strlen(buffered_message);
}
Inside the function, the message is printed out without problems. But when I try to use my function in main
, something goes wrong.
int main()
{
/* ... */
unsigned char *encrypted;
int len = encrypt(message, key, encrypted);
if (len > 0)
{
printf("The encrypted message %s\n", encrypted);
}
return 0;
}