I'm using a method of half for encrypting simple text:
Code:
char txt[100],txtc[100];
strcpy(txt,"HELLO");
txtc[0]=txt[0];
for(i=1;txt[i]!=0;i++)
{
if(txt[i-1]%2==1)
txt[i-1]+=1;
txtc[i]=(txt[i-1]/2)+(txt[i]/2);
}
Now assuming that this code would be decrypted in a logical way, can you tell me why do I encounter segmentation fault while the code is being processed?
And can someone say why my reputation is negative?? :|