c++学习log1
来源:互联网 发布:java开源加密工具 编辑:程序博客网 时间:2024/06/15 12:10
最近开始重学c++,
也是第一次博客 暂且来试试水吧
首先打算用c++写个简单的文档加密算法(当然只是初级的,能够读取txt文本然后简单加密解密一下就行了
--------------------------------------------------------------------------------------------------------------------------------------------
#include<windows.h>
#include<fstream.h>
void encryption(char *c,int n);//加密
void deciphering(char *,int );//解密
int main()
{
char buff2[100];
fstream wf("c:\\local.txt",ios::out|ios::in);
streampos po=wf.tellg();
wf.seekg(0);
cout<<' ';
while(wf.eof())
{
po=wf.tellg();
wf.getline(buff2,100);
cout<<buff2<<endl;
deciphering(buff2,100);
cout<<buff2<<endl;
wf.seekg(po);
wf << buff2<<"\n";//即使是写入也会使指针后移一行
}
return 0;
}
void encryption(char *c ,int n )
{
int max=strlen(c);
for(int i=0;i<max;i++)
{
c[i]+='王';
}
}
void deciphering(char *c ,int n)
{
int max=strlen(c);
for(int i=0;i<max;i++)
{
c[i]-='王';
}
}
- c++学习log1
- log1
- log1
- log1
- 2012/11/7 log1
- boost_1_47_0和log1.0的编译问题及解决
- C学习
- C++学习
- c ++ 学习
- 学习C
- c学习
- 学习C#!
- 学习C
- c学习
- c学习
- 学习C
- 学习C
- 学习C++
- Android按钮点击事件
- sicily 1177. Take Your Vitamins
- python 函数学习
- 普通树的存储与遍历(合集)
- hdu Flood-it!(IDA*算法)
- c++学习log1
- 深入理解计算机系统(2)
- notification几种点击事件
- 图片列表换行错位,图片无法左对齐怎么办
- 第3章 一切基于pom
- 推荐系统小结
- WEBSERVICE各家之说
- Unity3D开发技巧
- 基于opencv的相机之马赛克功能实现(九)