#include<stdio.h>

#include<string.h>

int main()

{

 char destination[25];

 char  *zhang="zhang ",*er=" er",*xiong=" xiong";

 strcpy(destination,zhang);//这相当于初始化

 strcat(destination,er);

 strcat(destination,xiong);



 printf("%s\n",destination);

 

 return 0;

}

c语言,strcat(),字符串拼接的更多相关文章

  1. C语言实现字符串拼接

    #include <stdio.h>#include <stdlib.h>#include <string.h> char* str_contact(const c ...

  2. C语言strcat()函数:字符串连接(拼接)

    C语言strcat()函数:字符串连接(拼接)   C语言 strcat() 函数用来将两个字符串连接(拼接)起来. 头文件:string.h 语法/原型: char*strcat(char* str ...

  3. C语言学习笔记之字符串拼接的2种方法——strcat、sprintf

    本文为原创文章,转载请标明出处 1. 使用strcat进行字符串拼接 #include <stdio.h> #include <stdlib.h> #include <s ...

  4. 嵌入式-C语言基础:字符串拼接函数strcat

    #include<stdio.h> #include <string.h> //实现字符串拼接 char * mystrcat(char * dest,char * src) ...

  5. 字符串拼接 strcat ;数组和指针的区别

    问题:字符串拼接 strcat 方法1: 开辟新空间,存放结果: #include <stdio.h> #include <stdlib.h> #include <str ...

  6. 【C语言学习笔记】字符串拼接的3种方法 .

    昨天晚上和@buptpatriot讨论函数返回指针(malloc生成的)的问题,提到字符串拼接,做个总结. #include<stdio.h> #include<stdlib.h&g ...

  7. C语言字符串拼接

    1.使用strcat进行字符串拼接 #include <stdio.h> #include <stdlib.h> #include <string.h> int m ...

  8. C语言常用字符串函数总结

    ANSI C中有20多个用于处理字符串的函数: 注意:const 形参使用了const限定符,表示该函数不会改变传入的字符串.因为源字符串是不能更改的. strlen函数: 函数原型:unsigned ...

  9. Objective的字符串拼接 似乎没有Swift方便,但也可以制做一些较为方便的写法

    NSString *str1 = @"字符串1"; NSString *str2 = @"字符串2"; //在同样条件下,Objective的字符串拼接 往往只 ...

  10. C语言之字符串处理函数

    C语言中字符串处理函数介绍 下面介绍8种基本的常用的字符串处理函数,在数值数组中也常常用到(部分函数).所有的C语言编译系统中一般都提供这些函数. 1.puts函数——输出字符串的函数 一般的形式为p ...

随机推荐

  1. Form 重置记录编号(app_record.for_all_record)

    A block lines has item line_number. When a record is deleted, line_number must be renumbered. step 1 ...

  2. shutdown,init,halt,poweroff,reboot的区别和联系, pkill -kill -t tty7注销

    前言 最近这些天,每天晚上关机前,都会在osc上发一条动弹,“我要init 0了,各位晚安啊”,这是一件再正常不过的事情了. 看似很平常的一件事情,不过在昨晚就被一位同学的回复给难住了,到底是什么样的 ...

  3. VJP1193 扫雷(状压)

    链接 保存当前行和前一行两行的状态 #include <iostream> #include<cstdio> #include<cstring> #include& ...

  4. [Hadoop源码解读](二)MapReduce篇之Mapper类

    前面在讲InputFormat的时候,讲到了Mapper类是如何利用RecordReader来读取InputSplit中的K-V对的. 这一篇里,开始对Mapper.class的子类进行解读. 先回忆 ...

  5. 结构体dict_table_t

    typedef struct dict_table_struct dict_table_t; /** Data structure for a database table. Most fields ...

  6. BZOJ_1096_[ZJOI2007]_仓库建设_(斜率优化动态规划+单调队列+特殊的前缀和技巧)

    描述 http://www.lydsy.com/JudgeOnline/problem.php?id=1096 有\(n\)个工厂,给出第\(i\)个工厂的到1号工厂的距离\(x[i]\),货物数量\ ...

  7. Linux下归档与压缩工具笔记

    tar具体使用笔记 归档工具 tar 语法 功能 选项 常见搭配 压缩工具 bzip2 工具 使用方法 gzip 工具 zip 工具 归档工具 tar tar是一个开源的Linux/Unix中最广泛使 ...

  8. 使用IIS配合VS调试

    当我们使用Visual Studio调试(Debug)的时候,通常我们会选择VS自带的ASP.NET Developerment Server(也是默认选项),当第一次调试的时候(按F5或Ctrl+F ...

  9. MFC VS2005 添加Override 和 Message

    VS2005 1.Overrides OnInitDialog() 在Class View选中 这个类,然后properties中点Message 旁边的Overrides, 添加OnInitDial ...

  10. NOIP2010关押罪犯 二分+二染色

    这个题一上来 没有思路,后来想没有思路就二分吧 那么我们来二分 首先,大于当前的mid值的关系,不能出现在一个集合里 (即关系形成的图是一个二分图,判定二分图可以二染色) 如果不能形成二分图,那么说明 ...