Yo, I currently have a project for my (Basic) Computer programming class which consists of making a simple Text Encoder/Decoder.
It'll read text from a file (named as "input.txt"), transformed/encoded using an encoding algorithm (to be created by me.) and saved into another file (named as "output.txt"). The decoder is simply this process in reverse only with the file named as "decoded.txt".
The problem I'm facing is I have no idea how an encoding algorithm (as well as the script that allows the encoder/decoder to read from the file) works or is made. This past term was literally my first experience with C++.
So far, here's what I've managed to come up with: (Note: I'm using Bloodshed Dev-C++)
Code:
#include <math.h>
#include <stdio.h>
#include <conio.h>
#include <stdlib.h> // The libraries
int main(){
int option; // Variable for selection.
printf("Select a Number to select a Function\n"); // The choices and selection.
printf("1. Encode\n");
printf("2. Decode\n");
printf("3. Close\n\n");
scanf("%i",&option);
switch(option){case 1: printf("\nYOU SHALL ENCODE!"); // Placeholder for Encoding script
break;
case 2: printf("\nYOU SHALL DECODE!"); // Placeholder for Decoding script
break;
case 3: printf("\nPress any key to continue."); // Script for cancellation.
break;
default: printf("\nINVALID, TRY AGAIN NEXT TIME.");
}
getch();}
Any form of advice or tutorials (which a complete idiot could understand XD) would be much appreciated.
Regards,
Joe
C++ Programming neophyte