In C, I do:
char* buffer=p->content; // p is a struct type and content is a char*
printf("buffer:%s\n",buffer);
My output is this:
@uffer: �@��^��0z
I don’t quite know why I get �@��^��0z, but I suspect is has to do with me incrementing mypointer incorrectly.
My main question is: Why is my “b” being converted to an “@” sign????????
The garbage data you are printing coincidentally contains a line printer control character known as carriage return, which your display device is interpreting as a command to move the cursor to the beginning of the line. Then if a @ character occurs, it overwrites the first character of your output.