derelict
Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Код: #include <iostream> #include <stdio.h> using namespace std; union { int state; struct { unsigned P : 1; unsigned Z : 1; unsigned C : 9; unsigned E : 1; unsigned N : 4; }bitFields; }channel; int main() { unsigned int value; cout<<"Enter channel state: "; scanf("%x", &value); channel.state = value; cout<<"Channel number: "<<channel.bitFields.N<<endl; cout<<"Is error: "<<channel.bitFields.E<<endl; cout<<"Interrupt code: "<<channel.bitFields.C<<endl; cout<<"Is finished: "<<channel.bitFields.P<<endl; getchar(); getchar(); } | | Всего записей: 232 | Зарегистр. 11-06-2006 | Отправлено: 02:26 02-12-2009 | Исправлено: derelict, 02:26 02-12-2009 |
|