Paste number 8469: bitfields test case

Index of paste annotations: 1

Paste number 8469: bitfields test case
Pasted by: vasi
When:5 years, 2 months ago
Share:Tweet this! | http://paste.lisp.org/+6J9
Channel:#fink
Paste contents:
Raw Source | XML | Display As
#include <stdio.h>

typedef struct
{
  int decal_for_dir:8;
  int size:24;
}
MESH_SIDE;


int main(void) {
	MESH_SIDE side;
	short x;
	
	side.decal_for_dir = 0;
	side.size = 0;
	
	printf("Before: %x, %x\n", side.decal_for_dir, side.size);
	
	x = 1;
	side.size = x;
	
	printf("After: %x, %x\n", side.decal_for_dir, side.size);
	
	return 0;
}

Annotations for this paste:

Annotation number 1: output
Pasted by: vasi
When:5 years, 2 months ago
Share:Tweet this! | http://paste.lisp.org/+6J9/1
Paste contents:
Raw Source | Display As
Before: 0, 0
After: 0, 0

Colorize as:
Show Line Numbers
Index of paste annotations: 1

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.