创建带有两个char *变量的字符串 [英] creatign a string with two char* varaibles

查看:87
本文介绍了创建带有两个char *变量的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,

谁能帮我从2个char *变量中创建一个字符串.

谢谢与问候,
Lokesh

Hi friends,

Can anybody please help me to create a string from 2 char* variables.

Thanks & Regards,
Lokesh

推荐答案

为两个字符数组分配足够大的内存区域,并使用 ^ ]-不要忘记从第一个结尾删除任何结尾的null,并确保在第二个结尾的/后面有一个null.
Allocate a area of memory big enough for both the two character arrays, and use strcpy[^] - don''t forget to remove any trailing null from the first, and make sure there is a null after / at the end of the second.


这篇关于创建带有两个char *变量的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆