正在加载

微信红包中介名字大全

  • 作者: 帝神小编
  • 来源: 帝神算命网
  • 2022-06-11
可以,我有很多人,看看头




  C标准没有输出二进制的,不过用itoa()可以实现到二进的转换。 1、在C语言程序中,可以使用标准库函数中printf()来向屏幕输出信息,或者使用sprintf()向缓冲区输出信息。对整数而言,可以使用%d、%o、%x(或%X)输出十进制形式、八进制、十六进制形式,但貌似缺乏二进制形式。 2、解决方式有两种,一种是利用Windows提供的itoa()函数,另一种自行设计一个新的函数: 代码一: /** Test.h */ #pragma once #ifndef Test_H #define Test_H /** use itoa() to print integers in the form of binary * @param[in] n the integer to print * @return void */ void printBinaryByItoa(unsigned int n); 代码二: /** Test.c */ #include #include void printBinaryByItoa(unsigned int n) { unsigned char data[33]; _itoa_s(n, data, 33, 2); printf("%sb\n



  我想多赚钱



  

文章来自♂帝神算命网♂,未经同意♂不得♂转载!

展开全文