Making decrypt function

 #include<stdio.h>

void decrypt(char *c){

    char *ptr = c;

    while(*ptr!='\0'){

        *ptr = *ptr - 1; 

        ptr++;

    }

}


int main(){

    char c[] = "Tvojm!Lvnbs";

    decrypt(c);

    printf("Decrypted string is: %s", c);

    return 0;

}

Comments

Popular posts from this blog

Snake game.c

Type declaration

Array with function