do{
for(i=0;i<=81;i++)
{
krypt[i] = krypt[i] + kontrol;
}
}while(i > 255);
That do while does nothing since i will always be 82 after the first iteration
see the FAQ on why gets is bad
I am sillyI am sillyI am sillyI am sillys
no one here cares if you are silly. Stating that fact generally will turn people off
should be
Here is an example using the same basic path you've chosen:
Code:
#include <stdio.h>
#include <string.h>
void crypt (char *, int);
void decrypt (char *, int);
int main (void)
{
char arr[81];
crypt(arr, 81);
decrypt(arr, 81);
puts(arr);
getchar();
return 0;
}
void crypt(char *arr, int length)
{
int i, key = 5;
strcpy (arr, "Encrypt this");
for(i=0; i<length; i++)
{
arr[i] = arr[i] + key;
}
}
void decrypt(char *arr, int length)
{
int i, key=5;
for ( i=0; i<81; i++)
{
arr[i] = arr[i] - key;
}
}