how would i assign a char pointer the value returned by a function that returns a string?
Code:#include <stdio.h> const char *str(void); int main() { char str2[50] *str1; printf("%s\n",str()); sprintf(str2, "%s",str()); printf("%s\n",str2); sprintf(str1, "%s",str()); printf("%s\n",str1); return 0; } const char *str(void) { return "this is a string"; }