所以我想通過以下操作來創建一個二維數組:C:無法iniitliaze與一維數組二維數組愛特梅爾工作室
unsigned char seqA[] = {1, 2, 3, 4, 5, 1, 2, 3, 4, 5};
unsigned char seqB[] = {1, 2, 3, 4, 4, 1, 2, 3, 4, 4};
unsigned char seqC[] = {3, 2, 1, 5, 4, 3, 2, 1, 5, 4};
unsigned char seqD[] = {1, 1, 2, 2, 3, 3, 4, 4, 5, 5};
unsigned char seq[][10] = {seqA, seqB, seqC, seqD};
而且我從試圖獲得大量的錯誤要做到這一點:
Warning 1 missing braces around initializer [-Wmissing-braces] C:\Users\Jonathan\Documents\Atmel Studio\6.2\GccApplication3\GccApplication3\GccApplication3.c 135 1 GccApplication3
Warning 2 (near initialization for 'seq[0]') [-Wmissing-braces] C:\Users\Jonathan\Documents\Atmel Studio\6.2\GccApplication3\GccApplication3\GccApplication3.c 135 1 GccApplication3
Warning 3 initialization makes integer from pointer without a cast [enabled by default] C:\Users\Jonathan\Documents\Atmel Studio\6.2\GccApplication3\GccApplication3\GccApplication3.c 135 1 GccApplication3
Warning 4 (near initialization for 'seq[0][0]') [enabled by default] C:\Users\Jonathan\Documents\Atmel Studio\6.2\GccApplication3\GccApplication3\GccApplication3.c 135 1 GccApplication3
Error 5 initializer element is not computable at load time C:\Users\Jonathan\Documents\Atmel Studio\6.2\GccApplication3\GccApplication3\GccApplication3.c 135 1 GccApplication3
Error 6 (near initialization for 'seq[0][0]') C:\Users\Jonathan\Documents\Atmel Studio\6.2\GccApplication3\GccApplication3\GccApplication3.c 135 1 GccApplication3
Warning 7 initialization makes integer from pointer without a cast [enabled by default] C:\Users\Jonathan\Documents\Atmel Studio\6.2\GccApplication3\GccApplication3\GccApplication3.c 135 1 GccApplication3
Warning 8 (near initialization for 'seq[0][1]') [enabled by default] C:\Users\Jonathan\Documents\Atmel Studio\6.2\GccApplication3\GccApplication3\GccApplication3.c 135 1 GccApplication3
Error 9 initializer element is not computable at load time C:\Users\Jonathan\Documents\Atmel Studio\6.2\GccApplication3\GccApplication3\GccApplication3.c 135 1 GccApplication3
Error 10 (near initialization for 'seq[0][1]') C:\Users\Jonathan\Documents\Atmel Studio\6.2\GccApplication3\GccApplication3\GccApplication3.c 135 1 GccApplication3
Warning 11 initialization makes integer from pointer without a cast [enabled by default] C:\Users\Jonathan\Documents\Atmel Studio\6.2\GccApplication3\GccApplication3\GccApplication3.c 135 1 GccApplication3
Warning 12 (near initialization for 'seq[0][2]') [enabled by default] C:\Users\Jonathan\Documents\Atmel Studio\6.2\GccApplication3\GccApplication3\GccApplication3.c 135 1 GccApplication3
Error 13 initializer element is not computable at load time C:\Users\Jonathan\Documents\Atmel Studio\6.2\GccApplication3\GccApplication3\GccApplication3.c 135 1 GccApplication3
Error 14 (near initialization for 'seq[0][2]') C:\Users\Jonathan\Documents\Atmel Studio\6.2\GccApplication3\GccApplication3\GccApplication3.c 135 1 GccApplication3
Warning 15 initialization makes integer from pointer without a cast [enabled by default] C:\Users\Jonathan\Documents\Atmel Studio\6.2\GccApplication3\GccApplication3\GccApplication3.c 135 1 GccApplication3
Warning 16 (near initialization for 'seq[0][3]') [enabled by default] C:\Users\Jonathan\Documents\Atmel Studio\6.2\GccApplication3\GccApplication3\GccApplication3.c 135 1 GccApplication3
Error 17 initializer element is not computable at load time C:\Users\Jonathan\Documents\Atmel Studio\6.2\GccApplication3\GccApplication3\GccApplication3.c 135 1 GccApplication3
Error 18 (near initialization for 'seq[0][3]') C:\Users\Jonathan\Documents\Atmel Studio\6.2\GccApplication3\GccApplication3\GccApplication3.c 135 1 GccApplication3
我在做什麼錯了?
結束了這樣做。謝謝。 – 2015-03-02 06:28:14
爲什麼不只是seq [0] [2]? – jschultz410 2015-03-02 06:30:30
@ jschultz410也沒問題。 – Vagish 2015-03-02 06:33:53