找错题
试题1:
void test1()
{
char string[10];
char* str1 = "0123456789";
strcpy(string, str1 );
}
查看答案
下面是C语言中两种if语句判断方式。请问哪种
写法更好?为什么?
试题2:
void test2()
{
char string[10], str1[10];
int i;
for(i=0; i<10; i++)
{
str1 = 'a';
}
strcpy(string, str1 );
}
程序改错
class mml
{
private:
static unsigned int x;
public:
mml(){ x++; }
mml(static unsigned int &) {x++;}
~mml{x--;}
pulic:
virtual mon() {} = 0;
static unsigned int mmc(){return x;}
......
};
class nnl:public mml
{
private:
static unsigned int y;
public:
nnl(){ x++; }
nnl(static unsigned int &) {x++;}
~nnl{x--;}
public:
virtual mon() {};
static unsigned int nnc(){return y;}
......
};
代码片断:
mml* pp = new nnl;
..........
delete pp;