Skip to content

Instantly share code, notes, and snippets.

@shakked
Created September 15, 2016 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shakked/7513d20f029d78e75dfd59c7f0d8a301 to your computer and use it in GitHub Desktop.
Save shakked/7513d20f029d78e75dfd59c7f0d8a301 to your computer and use it in GitHub Desktop.
#include "my.h"
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
int main(int argc, char **argv)
{
FILE *fp;
char str[60];
/* opening file for reading */
fp = fopen("encrypted.txt" , "r");
if(fp == NULL)
{
perror("Error opening file");
return(-1);
}
while(1) {
if( fgets (str, 4, fp) != NULL ) {
puts(str);
} else {
break;
}
}
fclose(fp);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment