以下代码在使用 clang 编译器的朋友 MacOs 机器上运行。但是,当我尝试在我的 Windows 机器上编译它时出现以下错误。
RGB(*image_mat)[width] = calloc(height, width * sizeof(RGB));
错误:
main.c:107:5: error: expected identifier or '(' before '[' token
107 | [width] = calloc(height, width * sizeof(RGB));
| ^
main.c:108:9: error: 'image_mat' undeclared (first use in this function)
108 | if (image_mat == NULL)```