K, hay hay boys. I'm preety noob at this so keep the responses low-key. Basically i'm trying to create a C program that after i enter in a string/sentence, it spits it back out coded ( encrypted ).
Its a very basic encryption, just if you enter 'a' it comes out 'b'. 'c' comes out 'd'. Basically + 1 letter, if its then 'z' = 'a'. I managed to do it entering in single characters at a time using a switch function to encode it. But one letter at a time isn't exactly time-saving.
Code:
#include <string.h>
#include <stdio.h>
main() {
char input[256];
char ia;
char ib;
char ic;
char id;
char ie;
char i_f;
char ig;
char ih;
char ii;
char ij;
char ik;
char il;
char im;
char in;
char io;
char ip;
char iq;
char ir;
char is;
char it;
char iu;
char iv;
char iw;
char ix;
char iy;
char iz;
// Variables *** FINISH ***
// Declarations *** START ***
ia = 'b';
ib = 'c';
ic = 'd';
id = 'e';
ie = 'f';
i_f = 'g';
ig = 'h';
ih = 'i';
ii = 'j';
ij = 'k';
ik = 'l';
il = 'm';
im = 'n';
in = 'o';
io = 'p';
ip = 'q';
iq = 'r';
ir = 's';
is = 't';
it = 'u';
iu = 'v';
iv = 'w';
iw = 'x';
ix = 'y';
iy = 'z';
iz = 'a';
//Declarations ***FINISH***
char input[256];
fgets( input, 256, stdin);
Now i don't know what to do from here, i don't know how to examine each string and change it. I know its something to do with strlen but just don't know how to.