close
#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 ;
}
}
全站熱搜
留言列表