In C, a string is nothing but a pointer to its first element. Constructions like char tempName[30]; declares an array of characters that is compatible with the pointer to the starting character, and therefore can be treated as a string.
In addition, the lines are not copied so simply, with = only the pointers themselves are copied, but not the contents of the line.
In order to copy the content, you need to use functions like strcpy . But in your example it is not necessary, because you already have a string!
Try to get rid of the selection of the tempName array.
char* tempName = CpyWithoutPoints(&str[0]); printf("%s ", tempName);
tempName[]to get a copy of the data in this array, the pointer to which is returned byCpyWithoutPoints(), then just copy them to the array -strcpy(tempName, CpyWithoutPoints(&str[0]));/ The very title of the question is simply terrible, it seems to indicate a complete misunderstanding of the essence of arrays and pointers. Obviously due to problems with basic knowledge of the computer device. - avp