Always follow conventions

Consider the following code:

typedef struct {
	int a;
	int b;

int main(void)
 int a=90,res;
 T1 m = {10,20};
 T1 *p = &m;
 res = p-->a;

 return 0;

if you run it it will display:


The problem here is because we wrote by mistake an extra dash so instead of writing:

res = p->a;

we wrote:


We didn’t get any compilation error because the compiler parsed it as a boolean expression:

if ( p--   >    a )
   res = 1;
   res = 0;

Because we have a local variable ‘a’ and also a struct member we got this pitfall



Follow conventions for declaring local variables and struct members (for example local with characters only and struct members begins with m_)