Before you can start accessing data off a pointer, you need to allocate some memory first; otherwise, it's undefined behavior. Your current structure needs two levels of allocation - one for the pointer to hola, and another for the hola itself. You also need to add another level of dereference, because -> works on pointers to structs, not on pointer to pointers to structs:
bic y;
y.r = malloc(sizeof(hola*));
*y.r = malloc(sizeof(hola));
// You need an extra level of dereference (i.e. an asterisk)
scanf("%d", &((*y.r)->a));
printf("%d", ((*y.r)->a));
// Don't forget to free the memory you allocated,
// in reverse order:
free(*y.r);
free(y.r);
Here is a demo on ideone.
ris holding a valid pointer. As it is now, it has not one, but two levels of indeterminate indirection.y->r->aor(*y.r)->aor(**y.r).ay->r->awon't work.yisn't a pointer.nr_queryto a value but used it as a control to a loop.