Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 28th, 2012  |  syntax: None  |  size: 0.32 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Mystery with bool data type
  2. #include <stdio.h>
  3. #include <stdbool.h>
  4.  
  5. int main()
  6. {
  7. bool a[5]={0,1,0,0,0};
  8. a[1]=3;
  9. printf("n bool is %d",a[1]);
  10. printf("n sizeof bool is %d and size of a is %d",sizeof(bool),sizeof(a));
  11.  
  12. bool b[10];
  13. printf("n bool is %d",b[1]);
  14.  
  15. }
  16.        
  17. bool is 1
  18.  sizeof bool is 1 and size of a is 5
  19.  bool is 4