#include <iostream>
#include <string>
#include <bitset> /* use : bitset  */
using namespace std;
 

 
 

int main()
{
    string strWorld = "MCT" ;

    for (int i = 0 ;  i< (int)strWorld.length() ;i++)
    {
        cout <<"Binary : " << bitset<8>(strWorld[i])<<" " <<endl; 
 
        int n = static_cast<int>(strWorld[i]) ;
        cout <<"int    : "<< n << endl ;

    }
}

 

 

 

文章標籤
全站熱搜
創作者介紹
創作者 Eric 的頭像
Eric

一個小小工程師的心情抒發天地

Eric 發表在 痞客邦 留言(0) 人氣(2,354)