1 #include <stdio.h> 2 int main(void) { 3 unsigned short str[5+1]; 4 const unsigned short length = sizeof(str)/sizeof(str[0]); 5 unsigned short x; 6 7 printf("Значение length = %hu\n", length); /* выведет 6 */ 8 9 for(x=0; x<length-1; x++) 10 str[x] = x; 11 12 str[x+1] = 5; 13 14 printf("Значение length = %hu\n", length); /* выведет 5 */ 15 16 return 0; 17 } Prog is purely experimental. Question: why has the length changed? If you remove 12: then all the rules. How does the code in 12: affect the length? Or is it something else? Explain, please.
read_filefunctionread_fileturn intoformat_disk, and dereferencing the pointer will send you to the police. Just never do that. - VladD