首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

10进制转2,8进制解决方法

2012-04-28 
10进制转2,8进制C/C++ code#includestdio.hvoid to_binary(unsigned long n,unsigned int)int main(voi

10进制转2,8进制

C/C++ code
#include<stdio.h>void to_binary(unsigned long n,unsigned int);int main(void){    unsigned long number;    unsigned int m;    printf("Enter an integer(q to quit):\n");    while(scanf("%ul%d",&number,&m)==1)    {        printf("Binary equivalent:");        to_binary(number,m);        putchar('\n');        printf("Enter an integer(q to quit):\n");    }    printf("Done!\n");    return 0;}void to_binary(unsigned long n,unsigned int c){    int r;    r=n%c;    if(n>=c)        to_binary(n/c);    putchar('0'+r);    return;}

 error C2660: 'to_binary' : function does not take 1 parameters
执行 cl.exe 时出错.

1.obj - 1 error(s), 0 warning(s)


[解决办法]
错误报告不已经说了
to_binary(n/c); 几个参数

热点排行