array of pointer give error above 11
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXWORD 30 /* max word size in characters */
#define N 10000 /* max number of words */
void sort_words(char *w[], int n);
void swap(char **, char **);
int main()
{
char *w[N]; /* an array of pointers */
char word[MAXWORD];
int n; /* number of words to be sorted */
int i; /* loop index variable */
char words;
n=0;
do {
words=getchar();
word[n]=words;
w[n]=&word[n];
printf("n is %d%c\n",n,*w[n]);
n++;
} while (words != EOF);
printf("%c\n",*w[11]);
return 0;
}
void sort_words(char *w[], int n)
{
}
void swap(char **p, char **q)
{
/* for you to complete ... */
}
whenever I want to display w[11] and below it give me window error but above 11 is fine . anyone have any idea ?