开发平台(Platform): (Ex: Win10, Linux, ...)
Linux
编译器(Ex: GCC, clang, VC++...)+目标环境(跟开发平台不同的话需列出)
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10)
额外使用到的函数库(Library Used): (Ex: OpenGL, ...)
non.
问题(Question):
我定义一个二维阵列要引入sub function.
同时定义Link list struct里也有相同的二维阵列
但gcc compiler解析出来的与我定义的原形不同,
不解为什么.
我的原形:
typedef unsigned char BYTE;
typedef BYTE TestMatrix[10][10];
sub function引入变量的写法:
LinkListNode *InserNode(LinkListNode *first, LinkListNode *theNode,
TestMatrix Matrix){
GCC Compiler fail:
test.cpp: In function ‘LinkListNode* InserNode(LinkListNode*, LinkListNode*,
BYTE (*)[10])’:
test.cpp:24:22: error: incompatible types in assignment of ‘BYTE (*)[10]
{aka unsigned char (*)[10]}’ to ‘TestMatrix {aka unsigned char [10][10]}’
inserNode->Matrix=Matrix;
喂入的资料(Input):
无
预期的正确结果(Expected Output):
compiler pass
错误结果(Wrong Output):
compiler fail
程式码(Code):(请善用置底文网页, 记得排版,禁止使用图档)
https://pastebin.com/embed_js/nBEkr5rC
补充说明(Supplement):
感谢.