I have to use same variable name with different user define datatypes.
Eg.
if (scan = NEAR)
{
Near_t p_Data = getData()->Near;
}
else if (scan == FAR)
{
Far_t p_Data = getData()->Far;
}
Data_1 = p_Data->d1;
Data_2 = p_Data->d2;
Thus I want to eliminate the repetitive code for different datatypes. In the above manner, it throws error since declaration is within the scope of conditional statement & also redefinition is happened How to achieve this functionality otherwise?