Hello guys,
#include<stdio.h>
#include<stdlib.h>
struct newtype {
char name;
};
int main() {
struct newtype a ;
struct newtype *b = malloc(10 * sizeof(struct newtype));
b -> name = 'Z';
a.name = 'P';
printf("Character to print1: %c\n",b->name);
printf("Character to print2: %c\n",a.name);
}
In my above code, I cant distinguish between the struct tag and pointer to struct. Are they both same ?? What exactly is the difference between b ā name = āZā; and a.name = āPā; ?