对结构体指针重命名,为什么老是显示未申请?

typedef struct pif
{
char name[20];
char num[12];
char qq[15];
char email[20];
}bs;

typedef struct pbs
{
bs data;
struct pbs *next;
}*ptbs;

ptbs head=(struct pbs*)malloc(sizeof(pbs)); //显示此处错误

error : 'pbs' undeclared here ( not in a function )
我已经定义了pbs,为什么此处还是显示未声明?

ptbs head=(struct pbs*)malloc(sizeof(pbs)); //显示此处错误 这行修改为:ptbs head=(struct pbs*)malloc(sizeof(struct pbs));