C is not Perl.

Abigail on 2003-04-14T10:46:18

Today I was writing a quick C program. I started off with the lines:

    # use <stdlib.h>
    # use <stdio.h>

and I didn't notice it until the compiler complained.

Abigail
(Darn, why isn't <PRE> allowed? That would make it a lot easier to show code.)


Re: C is not Perl.

jmcnamara on 2003-04-14T13:14:30

I recently spent some time staring at the following C code and wondering why it was giving a parse error:
if (p) { p++ } /* Error 1 */

But worse still was the following (simplified) awk program that returned 0 for the number of counted words:

awk '{$c += NF} END{print $c}' file   # Error 2

--
John.

1. Missing statement terminator. 2. Should be c instead of $c.

ecode

darobin on 2003-04-18T15:19:30

It's smarter <pre> .