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

编写strcat函数(6分) 已知strcat函数的原型是char *strcat (char *strDest, const char *st

编写strcat函数(6分) 已知strcat函数的原型是char *strcat (char *strDest, const char *strSrc); 其中strDest 是目的字符串,strSrc 是源字符串。 (1)不调用C++/C 的字符串库函数,请编写函数 strcat

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“编写strcat函数(6分) 已知strcat函数的原型是c…”相关的问题
第1题
试题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; // 用于保存字符串

};

点击查看答案
第2题
试题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; // 用于保存字符串

};

点击查看答案
第3题
回答下面的问题(6分) (1).Void GetMemory(char **p, int num) { *p = (char *)mallo

回答下面的问题(6分) (1).Void GetMemory(char **p, int num) { *p = (char *)malloc(num); } void Test(void) { char *str = NULL; GetMemory(&str, 100); strcpy(str, "hello"); printf(str); } 请问运行Test 函数会有什么样的结果?

点击查看答案
第4题
已知String类定义如下:class String{public:String(const char *str = NULL); // 通用构造函

已知String类定义如下:

class String

{

public:

String(const char *str = NULL); // 通用构造函数

String(const String &another); // 拷贝构造函数

~ String(); // 析构函数

String & perater =(const String &rhs); // 赋值函数

private:

char *m_data; // 用于保存字符串

};

尝试写出类的成员函数实现。

点击查看答案
第5题
已知strcpy 的函数原型:char *strcpy(char*strDest, const char *strSrc)其中strDest 是目的

已知strcpy 的函数原型:char *strcpy(char

*strDest, const char *strSrc)其中strDest 是目的字符

串,strSrc 是源字符串。不调用C++/C 的字符串库

函数,请编写函数strcpy。

点击查看答案
第6题
分别按如下函数原型编程计算并输出mxn阶矩阵的转置矩阵。其中,m和n的值由用户从键盘输入。已知m
和n的值都不超过10

编写一个能对任意mxn阶矩阵进行转置运算的函数Transpose() 。

点击查看答案
第7题
C标准库中和字符串操作有关的函数,像strcpy,strcat,sprintf,gets等函数中,数组和指针都有自动边界检查。()
点击查看答案
第8题
已知在一维数组A[m十n]中依次存放着两个顺序表(a0,a1,…,am-1)和(b0,b1..,
已知在一维数组A[m十n]中依次存放着两个顺序表(a0,a1,…,am-1)和(b0,b1..,

ba-1)。试编写一个函数,将数组中两个顺序表的位置互换,即将(b0,b1,…,bn-1)放在(a0,a1,…,am-1)的前面。

点击查看答案
第9题
下列属于VB数学函数的是()。

A.Abs()

B.Sin()

C.Cos()

D.Str()

点击查看答案
第10题
. void Test(void) { char *str = (char *) malloc(100); strcpy(str, “hello”);

. void Test(void) { char *str = (char *) malloc(100); strcpy(str, “hello”); free(str); if(str != NULL) { strcpy(str, “world”); printf(str); } } 请问运行Test 函数会有什么样的结果?

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