//输入一个值打印输出字节
void showbits(int parameter)
{
unsigned char byte,*p =(unsigned char *)¶meter;
int j;
if(p = null){
return;
}
else
for(j=0; j<sizeof(parameter);j++){
byte = *p;
int i;
for(i=0;i<8;i++){
if(0x80 & byte) putchar('1');
esle putchar('0');
byte << =1;
}
p++;
}
}
//输出字符串地址值
#include <iostream>
using std::cout;
using std::endl;
int main()
{
const char *pszStr = "this is a string";
// 输出字符串
cout << "字符串:" << pszStr << endl;
// 如我们所愿,输出地址值
cout << "字符串起始地址值: " << static_cast<const void *>(pszStr) << endl;
return 0;
}