Hi i was working on a project and was using a bool array when something wasn't working. I managed to narrow it down to this:
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
bool test[] = {true, true, false, true, true};
Serial.println(sizeof(test));
customPrintSize(test);
}
void customPrintSize(bool temp[])
{
Serial.println(sizeof(temp));
}
void loop() {
// put your main code here, to run repeatedly:
}
Serial monitor returns:
5
2
i have already worked around this problem by passing an extra variable containing the true size but was wondering why this occurs.
I am using Arduino 1.5.8 on windows 7 and sketch is running on moteino R4 (which has an atmega328)