实验 10 指针

//密码加密
#include<stdio.h>
#include<string.h>       
#define MAXLINE 80       //字符串少于80个字符
void encrypt(char*);       自定义 函数 
int main(void)
  {
  char line[MAXLINE];
  printf("Input the string:");
  gets(line);      //输入一串字符
  encrypt(line);
  printf("%s%s
","After being encryted:",line);    //输出一串字符
  return 0;
  }
  void encrypt(char *s)      //调用自定义函数
  {
  for(;*s!='';s++)      
  if(*s=='z')     
  *s='a';     //a与z调换
  else
  *s=*s+1;   //字符换到下一个
  
  } 
原文地址:https://www.cnblogs.com/zy1235/p/3422706.html