#include #include #include typedef unsigned char BYTE; int stringToByte(char* input, BYTE* output){ int i; int loop; loop = 0; i = 0; while (input[loop] != '\0'){ //printf("output : %d input : %d /", output[i], input[i]); output[i] = input [loop]; i++; loop++; //printf("output2 : %d input2 : %d\n", output[i],input[i]); } } long long convert(int n) { long long bin = 0; int rem, i = 1; while (n!=0) { rem = n % 2; n /= 2; bin += rem * i; i *= 10; } return bin; } int main (int argc, char **argv){ // **argv ou *argv[] FILE* flux; int longueurInstru; int i; int a[10]; int c,k,y=0; int test; BYTE *instruction = malloc(64*sizeof(int)); BYTE arr[50]; flux= fopen(argv[1], "r"); if (flux == NULL){ perror("fopen"); return EXIT_FAILURE; } if (flux){ while (fscanf(flux, "%[^\n] ", instruction) != EOF) { longueurInstru = strlen(instruction); stringToByte(instruction, arr); for (i=0; i