int a,b,c 请写函数实现C=a+b ,不

17 查阅
int a,b,c 请写函数实现C=a+b ,不可以改变数据类型,如将c改为long int,关键是如何处理溢出问题bool add (int a, int b,int *c){*c=a+b;retu

参考答案:

正确答案:

\r\n

分析:
struct bit
{ int a:3;
int b:2;
int c:3;
};
int main()
{
bit s;
char *c=(char*)&s;
cout<<sizeof(bit)<<endl;
*c=0x99;
cout << s.a <<endl <<s

数据类型