GCC linaro compiler throws error “unknown type name size_t”

前端 未结 3 1320
死守一世寂寞
死守一世寂寞 2021-02-02 11:46

I am using GCC Linaro compiler for compiling my code. Its throwing the error unknown type name size_t from libio.h. Its included from stdio.h

3条回答
  •  南笙
    南笙 (楼主)
    2021-02-02 12:24

    Both stdio.h and stdlib.h include the data type size_t. They include this data type because the functions declared in these headers either take size_t as a parameter, or return it as a return type. size_t itself is a typedef to an unsigned integral type and it's also returned by the sizeof operator.

    And because the sizeof operator is built into the C Programming Language itself, not included via some library, then how can size_t be an unknown type name?

提交回复
热议问题