Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdio.h"
- int taille(int* numOctets, int* octet) {
- if (octet[0] == 0) /* 0... */
- {
- *numOctets = 1;
- return 0;
- }
- else if (octet[1] == 1) /* 11... */
- {
- if (octet[2] == 0) /* 110... */
- {
- *numOctets = 2;
- return 0;
- }
- else if (octet[3] == 0) /* 1110 ... */
- {
- *numOctets = 3;
- return 0;
- }
- else if (octet[4] == 0) /* 11110...*/
- {
- *numOctets = 4;
- return 0;
- }
- else
- return 1;
- }
- else
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement