C Interesting Array initialization
- #include <stdio. h>
- int main()
- {
- int I = 0;
- Char a[1024x768];
- Char A0[ten] = {};
- Char A1[ten] = {1};
- Char A2[ten] = {1,};
- Char A3[ten] = {1, 1};
- for(i=0; I< 1024x768; I++){
- printf("%u", a[i]);
- A[i] = (i*i)%11;
- }
- printf("\ n------\ n");
- for(i=0; I<; I++){
- printf("%u | %u | %u%u\n ", A0[i], A1[i], A2[i], A3[i]);
- }
- printf("\ n");
- }
Results
- 0000000042949672804
- ------
- 0 | 1 | 1 1
- 0 | 0 | 0 1
- 0 | 0 | 0 0
- 0 | 0 | 0 0
- 0 | 0 | 0 0
- 0 | 0 | 0 0
- 0 | 0 | 0 0
- 0 | 0 | 0 0
- 0 | 0 | 0 0
- 0 | 0 | 0 0
Run the first time and this may not be the same, from the second time after the same.
1, a[10]; Just make a label, do not allocate memory, to a[0]= (1*1)%11 when allocating memory, but in the data section of the stack to find an address assigned to a, do not initialize;
2,a? , initialization 0 is done, and the given value is assigned to the specified position in A123.
3, the highlight is a0={} of the writing, I first try to, estimate this compiler related.
C Interesting Array initialization