小编Voi*_*ter的帖子

如何在没有文件,objdump或gdb的情况下知道二进制文件是否包含调试符号?

我需要知道二进制文件中是否包含调试符号.它是一个生产系统,因此没有像fileobjdump或等命令gdb.

可以在需要时提供更多信息.

操作系统:Debian

c c++ linux debugging

5
推荐指数
1
解决办法
4859
查看次数

十进制到二进制转换输出

我的代码有什么问题,任何人帮助我plz.这是一个十进制到二进制的转换.根据我的代码,输出将是2为10,3为11但它输出总是添加最后一个值,如3显示1110,添加以前的输出.我现在应该怎么做 ?帮我PLZ?

#include<iostream>
#include<stdio.h>
using namespace std;

int main(){

    long int decimalNumber,quotient;

    int binaryNumber[100],i=0,j;

    printf("Enter any decimal number: ");

    //scanf_s("%ld",&decimalNumber);
    while(scanf_s("%ld",&decimalNumber)==1)
    {

            quotient = decimalNumber;

            while(quotient!=0){
             binaryNumber[i++]= quotient % 2;
             quotient = quotient / 2;
           }

           printf("Equivalent binary value of decimal number %d: ",decimalNumber);

           for(j = i -1 ;j>= 0;j--)
               printf("%d",binaryNumber[j]);
           printf("\n");
           printf("Enter any decimal number: ");
    }
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

c c++ binary decimal

0
推荐指数
1
解决办法
463
查看次数

标签 统计

c ×2

c++ ×2

binary ×1

debugging ×1

decimal ×1

linux ×1