Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- using namespace std;
- struct pola_bitowe
- {
- bool b1 :1;
- bool b2 :1;
- bool b3 :1;
- bool b4 :1;
- bool b5 :1;
- bool b6 :1;
- bool b7 :1;
- bool b8 :1;
- };
- union
- {
- unsigned char znak;
- pola_bitowe pb;
- } ddd;
- int main()
- {
- string imie;
- cout<<"Podaj swoje imie: ";
- cin>>imie;
- for(unsigned int i =0; i<imie.length(); i++)
- {
- cout<<endl<<imie[i]<<" = ";
- ddd.znak = imie[i];
- cout<<ddd.pb.b8<<ddd.pb.b7<<ddd.pb.b6<<ddd.pb.b5<<ddd.pb.b4<<ddd.pb.b3<<ddd.pb.b2<<ddd.pb.b1;
- cout<<endl;
- }
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment