首页 > 其他 > 详细

C函数返回字符串

时间:2017-02-28 23:01:30      阅读:165      评论:0      收藏:0      [点我收藏+]

#include "stdio.h"

#define KEY 5;

int main()

{

char password[50] = "123456";

encrypt(password);

printf("加密后的字符串为:",password);

return 1;

}

 

/**

*加密函数

*返回字符串数组。数组名即数组的首地址,所有声明 char * 可以表示返回数组。

**/

char * encrypt(char password[])

{

int i = 0;

int count = strlen(password);

for(;i<count;i++)

{

password[i] = password[i] + i + KEY;

}

return password;

}

C函数返回字符串

原文:http://www.cnblogs.com/chenweichu/p/6480932.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!