拓冰建站拓冰建站
首页 / 资讯中心 / 正文

《C语言 | 二维数组传参的7种写法,哪几种会报错?》

main()函数中的7种写法哪几种是错误的会导致报错#includestdio.htypedefunsignedintuint16;constuint16 guarrFcgCurrent[3][3]{{1,2,3},{4,5,6},{7,8,9}};voidLookup1D16table(constuint16 valuetable[]){printf(%d\n,valuetable[0]);}voidLookup2D_8_16_To_16table(constuint16*valuetable){Lookup1D16table(valuetable);}intmain(){Lookup2D_8_16_To_16table((constuint16*)guarrFcgCurrent);// 写法1Lookup2D_8_16_To_16table(guarrFcgCurrent[0][0]);// 写法2Lookup2D_8_16_To_16table(guarrFcgCurrent[0]);// 写法3Lookup2D_8_16_To_16table((constuint16**)guarrFcgCurrent);// 写法4Lookup2D_8_16_To_16table(guarrFCurrent);// 写法5Lookup2D_8_16_To_16table(*guarrFcgCurrent[0]);// 写法6Lookup2D_8_16_To_16table(guarrFcgCurrent[0]);// 写法7return0;}
分享:

看完干货,该让你的企业上线了

免费需求沟通 · 48 小时内出具建站方案 · 河南本地可上门