O I hate C.. why: conflicting declaration 'unsigned char pulses [100][2]

As per title.

I am trying to compile an Infra Red sensor read sketch from: https://learn.adafruit.com/ir-sensor/using-an-ir-sensor

When it gets to line 33: uint16_t pulses[100][2]; // pair is high and low pulse

It fails with:

rawirdecodestruct:34: error: conflicting declaration 'unsigned char pulses [100][2]'

 unsigned char pulses[100][2];  // pair is high and low pulse 

                            ^

rawirdecode:32: error: 'pulses' has a previous declaration as 'uint16_t pulses [100][2]'

 uint16_t pulses[100][2];  // pair is high and low pulse

"

No wonder I hate C, but any help in learning the beast will be much appreciated. I have plenty of coding experience ranging from machine code to BASIC, via FORTRAN, COBOL and others, but never had and success with anything more than trivial C programs.

Thanks in advance Mike

No wonder I hate C

You are doing something stupid, like trying to use the same name for two different arrays, and somehow that is C's fault? Get over it.

I tried and the sketch compiled without errors.

Damn. It must be something to do with my development environment then. I'll set up a clean Arduino install and give it another go.

Why do you have rawirdecodestruct and rawirdecode ? They are separate sketches. They should not be in the same directory.

Pete

Code in two tabs in the IDE I suspect, both using the same name for the pulses array