Thursday 29 October 2015

Structure Pointers Simplified


I was running away when it came to structure pointers. It might be my mind block, that I never tried to properly learn structure pointers.

Once I did, it was all easy. You need a good approach for learning such seemingly complex but simple things.

Simple Definition

Structure Pointers are the pointers which points structure. Ha Ha Ha...

This might look funny but it is as simple as that. They are like any other char pointer and int pointers, but they points to a structure.

Wednesday 28 October 2015

Difference between uint8_t and unsigned char, uint16_t or uint32_t and unsigned int

Have you ever wondered why people uses different keywords to define the same variable in C or C++ program?

Sometimes you would have noticed that 8 bit variable has been defined as

unsigned char a;
uint8_t       b;

Also, many a times you would notice integer has been defined as

unsigned int c;
uint16_t     d;
uint32_t     e;

Initially when I was in the learning phase of C programming with microcontrollers, I used to get confused, what to use when.