📄 file_encrypt.cpp
字号:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
void file_encrypt()
{
FILE *fp;
int i,j;
char str[1024];
fp = fopen( "F:\\Backup\\C_Sample\\File_operating\\File_testing.txt", "r+" );
if(fp == NULL)
{
printf("cannot open the file\n");
exit(0);
}
i = 0;
while(1)
{
str[i] = fgetc(fp);
if( feof(fp) ) //fp overflow,reach the end of file.
break;
str[i++] += 1;
// str[i++] -= 1;
}
fseek(fp,0L,SEEK_SET);
for( j = 0; j < i; j++ )
fputc(str[j],fp);
fclose(fp);
printf("please check the File_testing.txt file\n");
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -