p1 = p2 = (struct student*)malloc(LEN);等价于p1 = (struct student*)malloc(LEN);p2 = (struct student*)malloc(LEN);吗?
这是不等价的,楼主可以通过比较地址来判断。
第一条是开辟出一段空间,p1与p2指向相同。
后面两条是开辟两段空间,p1与p2分别指向。