Here is my code:
Code:
#include <stdio.h>
#include <string.h>

void sayHi(char *);

int main()
{
	char *ptr;
	sayHi(ptr);
	printf("prt: %s\n", ptr);
	return 0;
}

void sayHi(char *str)
{
	char *temp = "hello\0";
	str = temp;
	printf("str: %s\n", str);
}
I am trying to assign the value "hello" to the pointer I created in main. In function sayHi, the string prints correctly after the pointer assignment. However, it doesn't print correctly in main. Please help.

Thanks