首页 > 考试题库
题目内容 (请给出正确答案)
[主观题]

试题7: void Test(void ){ char *str = (char *) malloc(100 ); strcpy(str, "hello" ); free

试题7:

void Test(void )

{

char *str = (char *) malloc(100 );

strcpy(str, "hello" );

free(str );

... //省略的其它语句

}

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“试题7: void Test(void ){ char *s…”相关的问题
第1题
试题7:void Test(void ){char *str = (char *) malloc(100 );strcpy(str, "hello" );free(st

试题7:

void Test(void )

{

char *str = (char *) malloc(100 );

strcpy(str, "hello" );

free(str );

... //省略的其它语句

}

点击查看答案
第2题
试题6:void GetMemory(char **p, int num ){*p = (char *) malloc(num );}void Test(void ){c

试题6:

void GetMemory(char **p, int num )

{

*p = (char *) malloc(num );

}

void Test(void )

{

char *str = NULL;

GetMemory(&str, 100 );

strcpy(str, "hello" );

printf(str );

点击查看答案
第3题
试题5:char *GetMemory(void ){char p[] = "hello world";return p;}void Test(void ){char *s

试题5:

char *GetMemory(void )

{

char p[] = "hello world";

return p;

}

void Test(void )

{

char *str = NULL;

str = GetMemory();

printf(str );

}

点击查看答案
第4题
试题6: void GetMemory(char **p, int num ){ *p = (char *) malloc(num );} void Test(void

试题6:

void GetMemory(char **p, int num )

{

*p = (char *) malloc(num );

}

void Test(void )

{

char *str = NULL;

GetMemory(&str, 100 );

strcpy(str, "hello" );

printf(str );

}

点击查看答案
第5题
试题4:void GetMemory(char *p ){p = (char *) malloc(100 );}void Test(void ){char *str =

试题4:

void GetMemory(char *p )

{

p = (char *) malloc(100 );

}

void Test(void )

{

char *str = NULL;

GetMemory(str );

strcpy(str, "hello world" );

printf(str );

}

点击查看答案
第6题
试题5: char *GetMemory(void ){ char p[] = "hello world"; return p; } void Test(void )

试题5:

char *GetMemory(void )

{

char p[] = "hello world";

return p;

}

void Test(void )

{

char *str = NULL;

str = GetMemory();

printf(str );

}

点击查看答案
第7题
试题4: void GetMemory(char *p ){ p = (char *) malloc(100 );} void Test(void ) { char *

试题4:

void GetMemory(char *p )

{

p = (char *) malloc(100 );

}

void Test(void )

{

char *str = NULL;

GetMemory(str );

strcpy(str, "hello world" );

printf(str );

}

点击查看答案
第8题
试题7:编写类String的构造函数、析构函数和赋值函数,已知类String的原型为: class String{ publi

试题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; // 用于保存字符串

};

点击查看答案
第9题
试题7:编写类String 的构造函数、析构函数和赋值函数,已知类String的原型为:class String{public:

试题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; // 用于保存字符串

};

点击查看答案
第10题
void test(void)

void test(void)

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改