Here if I comment out both the dynamic memory allocation lines the code does not work whereas it works fine if both the lines are included . Why?
#include <stdio.h>
#include <stdlib.h>
int main()
{
struct data
{
char *a;
char *b;
} p;
printf("\n%lu\n", sizeof(struct data));
// p.a=(char *)malloc(1);
// p.b=(char *)malloc(1);
printf("Enter a string ::");
scanf("%s", p.a);
printf("Enter another string ::");
scanf("%s", p.b);
printf("\n%s", p.a);
printf("\n%s", p.b);
return 0;
}