In below code ptr prints "hello world" but temp is blank though I am passing temp as address.What can be possible reasons?
#include <stdio.h>
#include <string.h>
#include <malloc.h
unsigned char temp[1024];
void func(unsigned char *ptr)
{
const char* x = "hello world";
ptr = (unsigned char*) x;
printf("ptr=%s\n",ptr);
}
int main ()
{
func(temp);
printf("temp=%s\n",temp);
return 0;
}