- /*
- * 程序的版权和版本声明部分
- * Copyright (c)2013, 烟台大学计算机学院学生
- * All rightsreserved.
- * 文件名称: date.cpp
- * 作 者:
- * 完成日期: 年 月 日
- * 版本号: v1.0
- * 输入描述:年月日
- * 问题描述:输出对应的那一天是这一年的第几天
- * 输出:第几天
- */
#include <iostream> using namespace std; char * stringcat(char *source, const char *dest); int main() { char s1[30]="I love "; char *s2="C++"; stringcat(s1,s2); cout<<s1<<endl; return 0; } char * stringcat(char *source, const char *dest) { //将字符串dest连接到字符串source的尾部 char *p; int i; for(p=source;*p!='\0';p++); for(i=0;dest[i]!='\0';i++,p++) { *p=dest[i]; } *p='\0'; return 0; }