新聞中心

EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > 把正整型轉(zhuǎn)換成2進(jìn)制與16進(jìn)制

把正整型轉(zhuǎn)換成2進(jìn)制與16進(jìn)制

作者: 時間:2016-11-28 來源:網(wǎng)絡(luò) 收藏
原題:Write the function itob(n,s,b) that converts the integer n into a base b character
representation in the string s. In particular, itob(n,s,16) formats s as a hexadecimal integer in s.
要求在同一個程序?qū)崿F(xiàn)2進(jìn)制16進(jìn)制的轉(zhuǎn)換。
程序:





執(zhí)行:(第一次flag為b)


總結(jié):
1.對于整型數(shù)組,