The compiler is right, you are misusing pointers.
Try
#ifndef Q_H
#define Q_H
#define ASCII_COUNT 128
#ifdef INCLUDE_KEYWORD
const char key[] = {'D','i','g','i','P','e','n'};
#endif
void encrypt(char* pletter, char key);
void decrypt(char* pletter, char key);
#endif // Q_H
and
#include <stdio.h>
#include <string.h>
#include "q.h"
#define ASCII_COUNT 128
void encrypt(char *pletter, char key)
{
*pletter=(char)((*pletter+key)%ASCII_COUNT);
}
void decrypt(char* pletter, char key)
{
*pletter=(char)(((*pletter+ASCII_COUNT)-key)%ASCII_COUNT);
}
int main()
{
char s[] = "foobar";
printf("plain '%s'\n", s);
for (unsigned n=0; n<strlen(s); ++n)
encrypt(&s[n], 'x');
printf("encrypted '%s'\n", s);
for (unsigned n=0; n<strlen(s); ++n)
decrypt(&s[n], 'x');
printf("decrypted '%s'\n", s);
return 0;
}
Note: You have to use pointers only if you really need to encrypt/decrypt
in-place (that is changing the original string content).