I have reading some example code on C language from ON Semiconductor. So I have saw like this structure definition in header file:
typedef struct //that is example structure
{
uint16_t features;
bool blt;
const struct anotherstruct *structinfo;
} name;
So there is the definition on .c file and then using like this in foo() function with memset:
static name lastname;
foo()
{
memset(&lastname,0,sizeof(name ))
lastname.features=23;
lastname.structinfo=info; //there isn't assigned any value for blt.But there will be...(maybe ı am thinking this is the reason...)
}
I have got some searching on this site and I know already, static definitions equal to zero. So why ON Semiconductor set to 0 lastname in addition?
DP:foo() function has called just once by designer. So that can't be reset function because this structure definition lastname used first in foo() function