View Single Post
  #1  
Old 01-30-2018, 08:00
dila dila is offline
Friend
 
Join Date: Jan 2010
Posts: 60
Rept. Given: 12
Rept. Rcvd 32 Times in 14 Posts
Thanks Given: 35
Thanks Rcvd at 74 Times in 20 Posts
dila Reputation: 32
Question Strange string encoding in C code

Can someone explain how this encoding works, thanks

Code:
int a[]={21,19,6,17,12};
for(int i=0;i<5;++i){
  int c=0;
  for(int j=0;j<5;++j){
    c+=a[j]<<(i*j);
  }
  printf("%c",'a'+c%31);
}
Reply With Quote