Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
binary to txt
#include <stdio.h> #include <math.h> int main(void) { char buffer[9], tmp[] = "Z", finalString[255] = {0}, tmpC; int i = 0, j; do { //printf("Byte input: \n"); scanf("%s", buffer); fgetc(stdin); tmpC = 0; for(j = 0; j < 8; j++) { tmp[0] = buffer[j]; buffer[j] = 0; tmpC += atoi(tmp) * pow(2, 7 - j); } if(tmpC >= 32 && tmpC <= 126) { finalString[i] = tmpC; } else { finalString[i] = '\0'; break; } }while(i++ < 255); printf("Final String: %s", finalString); return 0; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
string_ptr_to_fct_param_v2
linear hybrid cellular automaton reversible random bit generator stream cipher
Project 3 Part 1 v2
Assignment 3
example of scanf and basic integer manipulation
PRACTICE 1
150116_PrimoFactorial
array and its sum
19_1_7
thread SleepWakeup and mutex
stackse - search stackoverflow differently
Please log in to post a comment.