题目内容

在不用第三方参数的情况下,交换两个参数的值
#i nclude <stdio.h>

查看答案
更多问题

试题4:为什么标准头文件都有类似以下的结
构?
#ifndef __INCvxWorksh
#define __INCvxWorksh
#ifdef __cplusplus
extern "C" {
#endif
/*...*/
#ifdef __cplusplus
}
#endif
#endif /* __INCvxWorksh */

下面代码有什么问题?
Void test2()
{
char string[10], str1[10];
for(i=0; i<10;i++)
{
str1[i] ='a';
}
strcpy(string, str1);
}

试题7:编写类String 的构造函数、析构函数
和赋值函数,已知类String的原型为:
class String
{
public:
String(const char *str = NULL); // 普通构造函

String(const String &other); // 拷贝构造函数
~ String(void); // 析构函数
String & perate =(const String &other); // 赋值
函数
private:
char *m_data; // 用于保存字符串
};

写出运行结果:
{// test2
union V {
struct X {
unsigned char s1:2;
unsigned char s2:3;
unsigned char s3:3;
} x;
unsigned char c;
} v;
v.c = 100;
printf("%d", v.x.s3);
}

答案查题题库