I need to pass an array inside a routine and then to read its size.
typedef struct
{
unsigned char Name[20];
}Sensors_;
extern volatile Sensors_ Sensor;
then inside source file
I'm using this method
void Save(){
SaveValue(Sensor.Name)
}
void SaveValue(volatile unsigned char Array[]){
printf("%d",sizeof(Array));
}
The real size of my array is 20 characters, but i'm getting in output number 2. Why this is happening? I'm passing my array inside my method, so isn't the size same as my first array?
Also i don't want to pass it as Sensors_ cause it's a generic method for other names too.