Showing posts with label C++. Show all posts
Showing posts with label C++. Show all posts

Tuesday, 24 November 2015

Compiling and Running C programs in Ubuntu command line

 


Many of you might be knowing the C language thoroughly, but have you ever tried to run the very basic programs in the Linux through command line? You may not have done that, like me.

I had learned C programming using Borland C in the windows about 11 years ago, and then used various IDEs to compile and run the programs  for different platforms.

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.