Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char *komp_bin(char br[]) {
- char c;
- int l = strlen(br);
- int i = 0;
- char nov[l+1];
- while ((c = br[i]) != '\0') {
- if (c == '0') {
- nov[i] = '1';
- } else {
- nov[i] = '0';
- }
- i++;
- }
- nov[i+i] = '\0';
- cout << nov;
- return nov;
- }
Advertisement
Add Comment
Please, Sign In to add comment