Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2016
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. unsigned char stringToBinary(char tmpSubjectStatus[])
  2. {
  3. unsigned char tmpBinaryCh = 0;
  4. int i;
  5. for (i = 0; i < 5; i++){
  6. if (tmpSubjectStatus[i] == '1') tmpBinaryCh += 1 << (4 - i);
  7. }
  8. return tmpBinaryCh;
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement