illegal use of this type as an expressionsee declaration of 'STACK'

    xiaoxiao2021-12-14  31

       今天给结构体创建空间的时候突然出现这种错误。

      莫名其妙。。。

      illegal use of this type as an expression   

       see declaration of 'STACK'

    后来仔细看的时候发现,写错了一个东西。

    把t=(STACK *)malloc(STACK);改成 t=(STACK *)malloc(sizeof(STACK));就解决了。

    在网上也看到导致这个错误的原因2:C有严谨的格式。变量必须定义在函数开头。

    转载请注明原文地址: https://ju.6miu.com/read-965494.html

    最新回复(0)