链表的数据域不能存放string型吗?

像这样写输入数据时就会报异常: 0xC0000005如果注释掉string,只是输入int型就可以执行,哪有问题呢??

typedef struct Lnode
{
    string numID;
    /*int numTest;
    int numSeat;*/
    struct Lnode *next;
}Lnode;

void createLnode(Lnode *&head)
{
    head = (Lnode*)malloc(sizeof(Lnode));
    head->next = NULL;
    Lnode *p = NULL;//p指向头结点
    int n;
    cin >> n;
    for(int i=0;i<n;i++)
    {
        p = (Lnode*)malloc(sizeof(Lnode));
        cin >> p->numID>> p->numTest >> p->numSeat;
        p->next = NULL;
        p->next = head->next; head->next = p;

    }
}

int main()
{
    Lnode *a;
    createLnode(a);
    system("pause");
    return 0;

你的编译器是vc++ 6.0是不行的,要新版,而且要#include <string>

我也是这样的问题,请问大哥解决了吗