I can not figure this out
I am trying to learn C from the second edition of The C Programming Language and on two programs they won't compile, I am using GCC and code::blocks
the first is 1.5.4 Word Counting
#define IN 1
#define OUT 0
state = OUT;
if (c== '\n')
if (c ==' ':: c=='\n'::c=='\t')
printf("%d %d %d \n",nl,nw,nc);
the compiler tells me that there is an expected ')' before ':' token on line 13
also on 1.6 Arrays
int c, i, nwhite, nother;
else if(c==' ':: c=='\n'::c=='\t')
printf ("digits =");
for (i=0; i<10;++i)
printf(", white space =%d, other=%d\n",nwhite,nother);
On line 9 expected')' before '!' token then the same error as before on line 12.
Am I doing something wrong or is my compiler at fault? I have tried retyping these from blank files and still do not get results.
I am very frustrated and even though the code makes sense to me I am not exactly inspired with confidence from these errors.
Code::Blocks is version 12.11
Ia it CB or my compiler and if it is the compiler what can I do about it?
Last edited by Onceler; 02-09-2013 at 01:22 PM.