I am trying to print the names of my array with a for but the output gives me random letter and signs, I cant cast it correctly to print the names of the struct.
typedef struct{
// uint8_t name;
char *name[100];
char *lasTName[100];
}resFrame;
resFrame serverFrame;
for(int j=0;j<10;j++){
printf("%s",(char *)&serverFrame.name[j]);
}
Output:
�7��
I try with a for and with a other pointer but it gives me the same problem and sometimes a core dumped
name
allocated, most probably heap-allocated usingmalloc()
?? Better usechar **
to remove confusion.