c語言怎么把16進制轉化為二進制?
//將16進制的數保存到一個數組中,并將它一個個輸出#include <iostream>using namespace std;int main(){ int n = 0x3C; int a[8]; int i; for (i = 0; i != 8; ++i) { a[8 - 1 - i] = n % 2; n /= 2; } for (i = 0; i != 8; ++i) { cout << a[i]; } cout << endl; return 0;}