Hello was wondering if anyone could help me with this code. I am writing it for exercise 1-13 in the book "The C Programing Language". I am tring to get an array of word lengths. When I compile it i get the warning multi-character character constant. Also the code doesn't work. Any ideas?
thanks
#include <stdio.h>
#define IN 1
#define OUT 0
main()
{
int c, nc, i, state;
int ndigit[26];
state = OUT;
nc = 0;
for(i = 0; i < 26; ++i)
ndigit[i] = 0;
while ((c = getchar()) !='\t') {
if (c == ' ' || c == '|n' || c == '\t'){
state = OUT;
++ndigit[nc-'0'];
nc = 0;
}
else if (state == OUT) {
state = IN;
++nc;
}
else if (state == IN) {
++nc;
}
for (i = 0; i < 26; ++i)
printf("%d", ndigit[i]);
}
}