You cannot use both * and [ ], and also text[64] is out of bounds as its said in comment. You can use function strcpy to copy one string to another.

网友答案:

char text[64]; declares text as an array of 64 characters.

printf("%s\n", *text[64]) makes no sense, because:

text[64] points to the character after the end of the array; i.e. text[63] is the last character in the array.

*text[64] attempts to dereference the 64th item in the text array. But each item is not a pointer, but a character.

Perhaps you meant &text[n] where n is a number between 0 and 63, which would be a pointer to a character within the array, and hence a string. In C a string (what %s expects) is a pointer to a character, and the string is that character and all following up until a NUL.

This bit of your question is unclear:

Why cant I put a * in front of text[64],

(answered above)

since thats how you print the value, correct

I have no idea what that bit means. As per the above, %s expects a char *, i.e. a pointer to a character.

网友答案:

If you are trying to copy the contents of the pointer *pn to the character array text then you better use strcpy() function.

strcpy(text,pn);

will let you copy the contents.

You trying to print out the contents of the array. you can't use the * and [] together.
In case of a array
for example

char text[64]

as you have mentioned in your code

printf("%x",text);

will print the start of the allocated memory where the array lies.
when you do text[0] the start of the allocated memory address will be added with 0 and the contents of that memory will given back.
This is how an array work
Now if you are to use a dereferencing operator * then *text will give the 0th element of the array

*(text + 1)

will give you the second element of the array and so and so forth.
one more thing you can't use

printf("%s",text);

as the value that you are passing to the function is not a string but a character array as it does not have '\0' at its end.

网友答案:

Why cant I put a * in front of text[64]

You can! but not the way you have tried to do it.

For example, in a declaration, char *text[64]; would be used to create an array of strings, each 64 bytes in length. And would require allocation of memory using malloc()orcalloc()`, or an initializer such as:

char *text[64]={"this is a string1","this is string2"};

Which creates an array of 2 strings, each with 64 bytes (although only partially used), which could be used like this:

printf("%s\n", text[0]);
printf("%s\n", text[1]);

since that's how you print the value, correct? (referring to:printf("%s\n", *text[64]);)

No.

The argument char *pn refers to a single string.
If you want to copy this argument to the local variable:
First, change the line: