大佬求助
使用DEVc++编译一个C程序,定义共用体,实现一个整型数据按字节输出(以8进制数和字符两种形式输出)。 #include <stdio.h>int main(void)
{
union nc {
int n ;
unsigned char b ;
} x ;
x . n = 0x64436241 ;
printf("%03o %03o %03o %03o\n" , x . b , x . b , x . b , x . b) ;
printf("%c%c%c%c\n" , x . b , x . b , x . b , x . b) ;
}
编译、运行实况
D:\0002.Exercise\C>g++ -o u u.c
D:\0002.Exercise\C>u
101 142 103 144
AbCd
D:\0002.Exercise\C> 谢谢
页:
[1]