I am trying to get the nth character of a string. I am currently using this:
char ch = Word[n];
However, when I build it, it gives me the following error:
error: subscripted value is neither array nor pointer nor vector
I am very confused about why I have this error!
My Whole code is:
#include <stdio.h>
#include <string.h>
#define alpha[] [a b c d e f g h i j k m n o p q r s t u v w x y z]
hash(Word){
     char hashed;
    int t, length;
    length = strlen(Word);
    for (t; length; ++t) {
         char ch = Word[t];
         if((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
         {
            int position alpha[ch];
            ch += 9;
            strncat(hashed, &ch, 1);
         }
         else if(ch >= '0' && ch <= '9')
         {
             ch*=2;
             char letter alpha[ch];
             strncat(hashed, &ch, 1);
         }
         else
         { 
             strncat(hashed, &ch, 1);
         }
         printf("%s/n", hashed);
     }
     return hashed;
}
main(){
     printf("Please enter your string to hash: ")
     scanf("%s", WordToHash)
     char* HashedWord
     HashedWord = hash(WordToHash)
     printf("/nYour hashed word is %s", HashedWord)
}
My compiler is the basic one that is pre-installed when you install code::blocks through the AUR in manjaro.
By the way, I am a newbie to C (I only started yesterday)!
Thanks in advance!
 
    