File: union_check.c

package info (click to toggle)
xbat 1.11-9
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,236 kB
  • ctags: 796
  • sloc: ansic: 6,298; makefile: 654; sh: 63
file content (19 lines) | stat: -rw-r--r-- 249 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>

main()
{
      union {
	    int i;
	    short s[2];
      } uni;

      uni.i = 10;
      
      if(uni.s[0] == 10) { 
	    fprintf(stderr,"Set UNION 1.\n");
      }else{
	    fprintf(stderr,"Set UNION 0.\n");
      }
}