bolo17

Untitled

Aug 29th, 2020
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. % cat so30681402.c
  2. #include <stdio.h>
  3.  
  4. int main(void) {
  5.     int za[0];
  6.     printf("sizeof array with no elements is %d.\n", (int)sizeof za);
  7.     return 0;
  8. }
  9.  
  10. % clang -std=c99 -pedantic -Weverything so30681402.c
  11. so30681402.c:4:12: warning: zero size arrays are an extension
  12.       [-Wzero-length-array]
  13.     int za[0];
  14.            ^
  15. 1 warning generated.
  16.  
  17. % ./a.out
  18. sizeof array with no elements is 0.
  19. Get link:https://ouo.io/19y8ao
Add Comment
Please, Sign In to add comment