Binary to decimal in c

后端 未结 5 615
Happy的楠姐
Happy的楠姐 2020-12-19 20:51

I have a simple code to convert binary to decimal numbers. In my compiler, the decomposition works just fine for number less than 1000, beyond the output is always the same

5条回答
  •  暖寄归人
    2020-12-19 21:39

    #include   //printf
    #include  //strlen
    #include  //uintX_t or use int instead - depend on platform.
    
    /* reverse string */
    char *strrev(char *str){
        int end = strlen(str)-1;
        int start = 0;
    
        while( start

提交回复
热议问题