My c++ code:
#include <ncurses.h>
extern const unsigned int LENGHT=25;
extern unsigned int nv=0;
extern unsigned int charpos [LENGHT];
void CheckStringForChar(char chk, char &str, int N)
{ 
    for (int i = 0; i < N; i++) {
        if((char)str[i] == chk){
            charpos[nv]=i;
            nv++;
        }
    }
      
}
int main()
{
 char chk;
 char phrase[LENGHT];
 initscr(); /* Start curses mode */
 printw("Enter check char:"); /* Print Hello World */
 refresh(); /* Print it on to the real screen */
 chk = (char)getch(); /* Wait for user input */
 printf("%c",chk);
 
 addstr("\nEnter phrase to check:");
 refresh();
 getstr(phrase);
 
 printf("\nphrase is: %s",phrase);
 
 CheckStringForChar(chk, *phrase, LENGHT);
 endwin(); /* End curses mode */
 return 0;
}
Gives this error on compile time:
error: invalid types ‘char[int]’ for array subscript
I very recently started learning c/c++ so I'm aware that this is not the only problem/bad implementation of this code(just trying out). I'm open to any other kind of suggestions.
 
     
     
    